diff --git a/src/FrontendTemplate.php b/src/FrontendTemplate.php index ebdbbb2..12fe70e 100644 --- a/src/FrontendTemplate.php +++ b/src/FrontendTemplate.php @@ -24,7 +24,7 @@ class FrontendTemplate * * - any filters See Tpl::getFilters() * - * @param ArrayObject $attr The attributes + * @param ArrayObject $attr The attributes * * @return string */ diff --git a/src/Manage.php b/src/Manage.php index 07c0649..e0d69f7 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -67,7 +67,7 @@ class Manage extends Process $password = empty($_POST['filesalias_password']) ? '' : $_POST['filesalias_password']; if (preg_match('/^' . preg_quote(App::media()->root_url, '/') . '/', $target)) { - $target = preg_replace('/^' . preg_quote(App::media()->root_url, '/') . '/', '', $target); + $target = (string) preg_replace('/^' . preg_quote(App::media()->root_url, '/') . '/', '', $target); $found = Utils::getMediaId($target); if (!empty($found)) { diff --git a/src/Utils.php b/src/Utils.php index 98fecc6..1965a78 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -177,6 +177,6 @@ class Utils ->and('media_file = ' . $sql->quote($target)) ->select(); - return $rs->count() ? (int) $rs->f('media_id') : 0; + return !is_null($rs) && $rs->count() ? (int) $rs->f('media_id') : 0; } }