code review
This commit is contained in:
parent
d8dc27223e
commit
2a4939bbd5
@ -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
|
||||
*/
|
||||
|
@ -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)) {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user