code review

This commit is contained in:
Jean-Christian Paul Denis 2023-11-04 11:54:04 +01:00
parent d8dc27223e
commit 2a4939bbd5
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
3 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ class FrontendTemplate
*
* - any filters See Tpl::getFilters()
*
* @param ArrayObject $attr The attributes
* @param ArrayObject<string, mixed> $attr The attributes
*
* @return string
*/

View File

@ -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)) {

View File

@ -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;
}
}