]> git.mxchange.org Git - friendica.git/blobdiff - mod/wall_upload.php
Better content detection for posts to Twitter
[friendica.git] / mod / wall_upload.php
index 3e88bd76b537404cf5b8bb510a9fe9f319f84bda..164ca470c3c9cc042e4e0709b0086c3b734c79d2 100644 (file)
@@ -3,12 +3,16 @@
 /**
  * @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\System;
+use Friendica\Core\Config;
+
 require_once 'include/Photo.php';
 
 function wall_upload_post(App $a, $desktopmode = true) {
@@ -172,7 +176,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
        logger("File upload src: " . $src . " - filename: " . $filename .
                " - size: " . $filesize . " - type: " . $filetype, LOGGER_DEBUG);
 
-       $maximagesize = get_config('system', 'maximagesize');
+       $maximagesize = Config::get('system', 'maximagesize');
 
        if (($maximagesize) && ($filesize > $maximagesize)) {
                $msg = sprintf(t('Image exceeds size limit of %s'), formatBytes($maximagesize));
@@ -225,7 +229,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
        $ph->orient($src);
        @unlink($src);
 
-       $max_length = get_config('system', 'max_image_length');
+       $max_length = Config::get('system', 'max_image_length');
        if (! $max_length) {
                $max_length = MAX_IMAGE_LENGTH;
        }
@@ -298,9 +302,9 @@ function wall_upload_post(App $a, $desktopmode = true) {
                $picture["width"]     = $r[0]["width"];
                $picture["height"]    = $r[0]["height"];
                $picture["type"]      = $r[0]["type"];
-               $picture["albumpage"] = App::get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash;
-               $picture["picture"]   = App::get_baseurl() . "/photo/{$hash}-0." . $ph->getExt();
-               $picture["preview"]   = App::get_baseurl() . "/photo/{$hash}-{$smallest}." . $ph->getExt();
+               $picture["albumpage"] = System::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $hash;
+               $picture["picture"]   = System::baseUrl() . "/photo/{$hash}-0." . $ph->getExt();
+               $picture["preview"]   = System::baseUrl() . "/photo/{$hash}-{$smallest}." . $ph->getExt();
 
                if ($r_json) {
                        echo json_encode(array('picture'=>$picture));
@@ -318,9 +322,9 @@ function wall_upload_post(App $a, $desktopmode = true) {
 /* mod Waitman Gobble NO WARRANTY */
        // if we get the signal then return the image url info in BBCODE
        if ($_REQUEST['hush']!='yeah') {
-               echo  "\n\n" . '[url=' . App::get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . App::get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n";
+               echo  "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . System::baseUrl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n";
        } else {
-               $m = '[url='.App::get_baseurl().'/photos/'.$page_owner_nick.'/image/'.$hash.'][img]'.App::get_baseurl()."/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]";
+               $m = '[url='.System::baseUrl().'/photos/'.$page_owner_nick.'/image/'.$hash.'][img]'.System::baseUrl()."/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]";
                return($m);
        }
 /* mod Waitman Gobble NO WARRANTY */