use Friendica\Object\Image;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
+use Friendica\Util\Security;
require_once 'include/dba.php';
// Remove the cached photo
$a = get_app();
- $basepath = $a->get_basepath();
+ $basepath = $a->getBasePath();
if (is_dir($basepath . "/photo")) {
$filename = $basepath . '/photo/' . $hash . '-4.' . $Image->getExt();
*/
public static function getAlbums($uid, $update = false)
{
- $sql_extra = permissions_sql($uid);
+ $sql_extra = Security::permissions_sql($uid);
$key = "photo_albums:".$uid.":".local_user().":".remote_user();
$albums = Cache::get($key);
WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra
GROUP BY `album` ORDER BY `created` DESC",
intval($uid),
- dbesc('Contact Photos'),
- dbesc(L10n::t('Contact Photos'))
+ DBA::escape('Contact Photos'),
+ DBA::escape(L10n::t('Contact Photos'))
);
} else {
// This query doesn't do the count and is much faster
FROM `photo` USE INDEX (`uid_album_scale_created`)
WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra",
intval($uid),
- dbesc('Contact Photos'),
- dbesc(L10n::t('Contact Photos'))
+ DBA::escape('Contact Photos'),
+ DBA::escape(L10n::t('Contact Photos'))
);
}
Cache::set($key, $albums, CACHE_DAY);