diff --git a/include/admin/maintenance.inc.php b/include/admin/maintenance.inc.php index 1f5384c86..18c6834cc 100644 --- a/include/admin/maintenance.inc.php +++ b/include/admin/maintenance.inc.php @@ -65,7 +65,7 @@ $data['maintenance_mode'] = serendipity_db_bool(serendipity_get_config_var("maintenanceMode", false)); -$data['maintenance_mode_end'] = strftime('%d.%m.%y %T', serendipity_get_config_var("maintenanceModeEnd")); +$data['maintenance_mode_end'] = date('j.n.Y e', serendipity_get_config_var("maintenanceModeEnd")); $data['maintenance_mode_active'] = $data['maintenance_mode'] && time() < serendipity_get_config_var("maintenanceModeEnd", 0); # php 8 compat section diff --git a/include/db/postgres.inc.php b/include/db/postgres.inc.php index ec32b3831..687c626f9 100644 --- a/include/db/postgres.inc.php +++ b/include/db/postgres.inc.php @@ -89,7 +89,18 @@ function serendipity_db_reconnect() { * @return string output string */ function serendipity_db_escape_string($string) { - return pg_escape_string($string); + global $serendipity; + + if (is_null($string)) + return $string; + + if (version_compare(PHP_VERSION, '8.1.0', '<')) { + # Versions before 8.1 give the connection by default + return pg_escape_string($string); + } + + # From PHP 8.1 onwards + return pg_escape_string($serendipity['dbConn'], $string); } /** diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index 523281e72..5b58c8f8d 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -1390,13 +1390,16 @@ function serendipity_updertEntry($entry) { serendipity_plugin_api::hook_event('backend_entry_presave', $entry); - $categories = $entry['categories']; + $categories = $entry['categories'] ?? null; unset($entry['categories']); if (array_key_exists('had_categories', $entry)) { $had_categories = $entry['had_categories']; unset($entry['had_categories']); } + else { + $had_categories = null; + } $newEntry = 0; $exflag = 0; @@ -1414,7 +1417,7 @@ function serendipity_updertEntry($entry) { $entry['extended'] = ''; } - if (strlen($entry['extended'])) { + if (isset($entry['extended']) && strlen($entry['extended'])) { $exflag = 1; } diff --git a/include/functions_permalinks.inc.php b/include/functions_permalinks.inc.php index afeb41c9b..709979b5d 100644 --- a/include/functions_permalinks.inc.php +++ b/include/functions_permalinks.inc.php @@ -10,12 +10,16 @@ * Converts a string into a filename that can be used safely in HTTP URLs * * @access public - * @param string input string + * @param string input string|null * @param boolean Shall dots in the filename be removed? (Required for certain regex rules) - * @return string output string + * @return string output string|null */ function serendipity_makeFilename($str, $stripDots = false) { + if (is_null($str)) { + return $str; + } + // These are UTF-8 replacements happening regardless of selected locale static $pre_from = array( '🇦', diff --git a/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php b/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php index 4dedada70..54348d7fa 100644 --- a/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php +++ b/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php @@ -878,7 +878,8 @@ function event_hook($event, &$bag, &$eventData, $addData = null) } } - if ($addData['preview'] && is_array($serendipity['POST']['properties']) && count($serendipity['POST']['properties']) > 0){ + if ($addData['preview'] && isset($serendipity['POST']['properties']) && + is_array($serendipity['POST']['properties']) && count($serendipity['POST']['properties']) > 0){ $parr = array(); $supported_properties = serendipity_event_entryproperties::getSupportedProperties(); foreach($supported_properties AS $prop_key) { diff --git a/templates/2k11/admin/overview.inc.tpl b/templates/2k11/admin/overview.inc.tpl index 0f5775b72..ebd0ef9b0 100644 --- a/templates/2k11/admin/overview.inc.tpl +++ b/templates/2k11/admin/overview.inc.tpl @@ -88,7 +88,7 @@ - {if !$showFutureEntries && ($entry.timestamp >= $serverOffsetHour) && $entry.isdraft == "false"} + {if !$showFutureEntries && ($entry.timestamp >= $serverOffsetHour) && $entry.isdraft[0] == "f"} {$entry.timestamp|formatTime:$CONST.DATE_FORMAT_SHORT} {/if} {if isset($entry.properties.ep_is_sticky) && $entry.properties.ep_is_sticky} {$CONST.STICKY_POSTINGS} {/if} - {if $entry.isdraft == "true"} + {if $entry.isdraft[0] == "t"} {$CONST.DRAFT} {/if}