]> git.mxchange.org Git - friendica.git/commitdiff
Static methods should be called statically
authorMichael <heluecht@pirati.ca>
Sat, 21 Oct 2017 16:13:25 +0000 (16:13 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 21 Oct 2017 16:13:25 +0000 (16:13 +0000)
include/Photo.php
mod/photo.php

index a86942ee29486452b7bd938fa6d71fb05320ddd9..457a2e31c467ef1afe305318c06a5adf5408adee 100644 (file)
@@ -26,7 +26,7 @@ class Photo {
        /**
         * @brief supported mimetypes and corresponding file extensions
         */
-       static function supportedTypes() {
+       static public function supportedTypes() {
                if (class_exists('Imagick')) {
 
                        // Imagick::queryFormats won't help us a lot there...
@@ -49,7 +49,7 @@ class Photo {
 
        public function __construct($data, $type=null) {
                $this->imagick = class_exists('Imagick');
-               $this->types = $this->supportedTypes();
+               $this->types = static::supportedTypes();
                if (!array_key_exists($type, $this->types)){
                        $type='image/jpeg';
                }
index e223808307f08e5534e35b12a9ba75568734fad7..72b7e8e95a00610724ff59655ee54dceb10e298d 100644 (file)
@@ -202,12 +202,15 @@ function photo_init(App $a) {
        if ($public and ($file != "")) {
                // If the photo path isn't there, try to create it
                $basepath = $a->get_basepath();
-               if (!is_dir($basepath."/photo"))
-                       if (is_writable($basepath))
+               if (!is_dir($basepath."/photo")) {
+                       if (is_writable($basepath)) {
                                mkdir($basepath."/photo");
+                       }
+               }
 
-               if (is_dir($basepath."/photo"))
+               if (is_dir($basepath."/photo")) {
                        file_put_contents($basepath."/photo/".$file, $data);
+               }
        }
 
        killme();