-
-require_once('include/Photo.php');
-
-function wall_upload_post(App $a, $desktopmode = true) {
-
- logger("wall upload: starting new upload", LOGGER_DEBUG);
-
- $r_json = (x($_GET,'response') && $_GET['response']=='json');
-
- if($a->argc > 1) {
- if(! x($_FILES,'media')) {
+/**
+ * @file mod/wall_upload.php
+ * @brief Module for uploading a picture to the profile wall
+ *
+ * By default the picture will be stored in the photo album with the name Wall Photos.
+ * You can specify a different album by adding an optional query string "album="
+ * to the url
+ */
+
+use Friendica\App;
+use Friendica\Core\L10n;
+use Friendica\Core\Logger;
+use Friendica\Core\System;
+use Friendica\Core\Config;
+use Friendica\Database\DBA;
+use Friendica\Model\Contact;
+use Friendica\Model\Photo;
+use Friendica\Object\Image;
+
+function wall_upload_post(App $a, $desktopmode = true)
+{
+ Logger::log("wall upload: starting new upload", LOGGER_DEBUG);
+
+ $r_json = (x($_GET, 'response') && $_GET['response'] == 'json');
+ $album = (x($_GET, 'album') ? notags(trim($_GET['album'])) : '');
+
+ if ($a->argc > 1) {
+ if (!x($_FILES, 'media')) {