Archived
1
0

php 8 compat for ML item insert into article

This commit is contained in:
onli
2021-05-13 20:16:21 +02:00
parent 28c199c7aa
commit e448d1c384
3 changed files with 17 additions and 11 deletions
+6 -2
View File
@@ -111,7 +111,9 @@ function serendipity_fetchImagesFromDatabase($start=0, $limit=0, &$total=null, $
if (! (isset($orderfields[$f]) || $f == "fileCategory") || empty($fval)) {
continue;
}
$cond['parts']['filter'] = '';
if (is_array($fval)) {
if (empty($fval['from']) || empty($fval['to'])) {
continue;
@@ -135,7 +137,7 @@ function serendipity_fetchImagesFromDatabase($start=0, $limit=0, &$total=null, $
(i.authorid = " . (int)$fval . ")
)\n";
$cond['joinparts']['hiddenproperties'] = true;
} elseif ($orderfields[$f]['type'] == 'int') {
} elseif (($orderfields[$f]['type'] ?? null) == 'int') {
if (substr($f, 0, 3) === 'bp.') {
$realf = substr($f, 3);
$cond['parts']['filter'] .= " AND (bp2.property = '$realf' AND bp2.value = '" . serendipity_db_escape_string(trim($fval)) . "')\n";
@@ -3301,6 +3303,8 @@ function serendipity_showMedia(&$file, &$paths, $url = '', $manage = false, $lin
$media['paths'] =& serendipity_getMediaPaths();
}
if (! isset($media['filter']['fileCategory']) ) { $media['filter']['fileCategory'] = null; }
$serendipity['smarty']->assignByRef('media', $media);
if ($enclose) {