]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Photo.php
Unescape admin warning text
[friendica.git] / src / Model / Photo.php
index 372e875ea7b587e5f4dcd35802fa68d834c72976..4a9e11c55472deb4123d375dbcdf8c80284185ef 100644 (file)
@@ -16,8 +16,6 @@ use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Network;
 use Friendica\Util\Security;
 
-require_once 'include/dba.php';
-
 /**
  * Class to handle photo dabatase table
  */
@@ -97,7 +95,7 @@ class Photo
                $photo = DBA::selectFirst(
                        'photo', ['resource-id'], ['uid' => $uid, 'contact-id' => $cid, 'scale' => 4, 'album' => 'Contact Photos']
                );
-               if (x($photo['resource-id'])) {
+               if (!empty($photo['resource-id'])) {
                        $hash = $photo['resource-id'];
                } else {
                        $hash = self::newResource();
@@ -115,7 +113,7 @@ class Photo
                $type = Image::guessType($image_url, true);
                $Image = new Image($img_str, $type);
                if ($Image->isValid()) {
-                       $Image->scaleToSquare(175);
+                       $Image->scaleToSquare(300);
 
                        $r = self::store($Image, $uid, $cid, $hash, $filename, 'Contact Photos', 4);
 
@@ -172,7 +170,7 @@ class Photo
                }
 
                if ($photo_failure) {
-                       $image_url = System::baseUrl() . '/images/person-175.jpg';
+                       $image_url = System::baseUrl() . '/images/person-300.jpg';
                        $thumb = System::baseUrl() . '/images/person-80.jpg';
                        $micro = System::baseUrl() . '/images/person-48.jpg';
                }
@@ -253,7 +251,7 @@ class Photo
                                        DBA::escape(L10n::t('Contact Photos'))
                                );
                        }
-                       Cache::set($key, $albums, CACHE_DAY);
+                       Cache::set($key, $albums, Cache::DAY);
                }
                return $albums;
        }
@@ -265,7 +263,7 @@ class Photo
        public static function clearAlbumCache($uid)
        {
                $key = "photo_albums:".$uid.":".local_user().":".remote_user();
-               Cache::set($key, null, CACHE_DAY);
+               Cache::set($key, null, Cache::DAY);
        }
 
        /**