make use of Config class

This commit is contained in:
rabuzarus 2017-03-25 21:07:12 +01:00
parent a2ad013830
commit b6ab3bdd36

View File

@ -9,8 +9,11 @@
* to the url * to the url
*/ */
use \Friendica\Core\Config;
require_once 'include/Photo.php'; require_once 'include/Photo.php';
function wall_upload_post(App $a, $desktopmode = true) { function wall_upload_post(App $a, $desktopmode = true) {
logger("wall upload: starting new upload", LOGGER_DEBUG); logger("wall upload: starting new upload", LOGGER_DEBUG);
@ -172,7 +175,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
logger("File upload src: " . $src . " - filename: " . $filename . logger("File upload src: " . $src . " - filename: " . $filename .
" - size: " . $filesize . " - type: " . $filetype, LOGGER_DEBUG); " - size: " . $filesize . " - type: " . $filetype, LOGGER_DEBUG);
$maximagesize = get_config('system', 'maximagesize'); $maximagesize = Config::get('system', 'maximagesize');
if (($maximagesize) && ($filesize > $maximagesize)) { if (($maximagesize) && ($filesize > $maximagesize)) {
$msg = sprintf(t('Image exceeds size limit of %s'), formatBytes($maximagesize)); $msg = sprintf(t('Image exceeds size limit of %s'), formatBytes($maximagesize));
@ -225,7 +228,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
$ph->orient($src); $ph->orient($src);
@unlink($src); @unlink($src);
$max_length = get_config('system', 'max_image_length'); $max_length = Config::get('system', 'max_image_length');
if (! $max_length) { if (! $max_length) {
$max_length = MAX_IMAGE_LENGTH; $max_length = MAX_IMAGE_LENGTH;
} }