Apply PHP8 compat fixes for backend controllers
Taken from https://github.com/s9y/Serendipity/pull/750
This commit is contained in:
parent
395d018908
commit
5013d583f2
@ -11,7 +11,7 @@ if (!serendipity_checkPermission('adminCategories')) {
|
||||
}
|
||||
|
||||
$admin_category = (!serendipity_checkPermission('adminCategoriesMaintainOthers') ? "AND (authorid = 0 OR authorid = " . (int)$serendipity['authorid'] . ")" : '');
|
||||
$data = array();
|
||||
$data = array('post_save' => false, 'doDelete' => false, 'delete' => false, 'edit' => false, 'new' => false);
|
||||
/* Add a new category */
|
||||
if (isset($_POST['SAVE']) && serendipity_checkFormToken()) {
|
||||
$name = $serendipity['POST']['cat']['name'];
|
||||
|
@ -12,7 +12,7 @@ $summaryLength = 200;
|
||||
$errormsg = array();
|
||||
$msg = array();
|
||||
|
||||
if ($serendipity['POST']['formAction'] == 'multiDelete' && sizeof($serendipity['POST']['delete']) != 0 && serendipity_checkFormToken()) {
|
||||
if (isset($serendipity['POST']['formAction']) && $serendipity['POST']['formAction'] == 'multiDelete' && sizeof($serendipity['POST']['delete']) != 0 && serendipity_checkFormToken()) {
|
||||
if ($serendipity['POST']['togglemoderate'] != '') {
|
||||
foreach ( $serendipity['POST']['delete'] as $k => $v ) {
|
||||
$ac = serendipity_approveComment((int)$k, (int)$v, false, 'flip');
|
||||
@ -204,49 +204,46 @@ if (isset($serendipity['GET']['adminAction']) && ($serendipity['GET']['adminActi
|
||||
/* Searchable fields */
|
||||
$filters = array('author', 'email', 'ip', 'url', 'body', 'referer');
|
||||
|
||||
/* Compress the filters into an "AND" SQL query, and a querystring */
|
||||
$and = '';
|
||||
$searchString = '';
|
||||
/* Compress the filters into an "AND" SQL query, and a querystring. Also init the GET variable if empty, to not die later */
|
||||
foreach ($filters as $filter) {
|
||||
$and .= (!empty($serendipity['GET']['filter'][$filter]) ? "AND c.". $filter ." LIKE '%". serendipity_db_escape_string($serendipity['GET']['filter'][$filter]) ."%'" : "");
|
||||
$searchString .= (!empty($serendipity['GET']['filter'][$filter]) ? "&serendipity[filter][". $filter ."]=". serendipity_specialchars($serendipity['GET']['filter'][$filter]) : "");
|
||||
if (! isset($serendipity['GET']['filter'][$filter])) {
|
||||
$serendipity['GET']['filter'][$filter] = null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($serendipity['GET']['filter']['show'] == 'approved') {
|
||||
$and .= "AND status = 'approved'";
|
||||
$searchString .= "&serendipity[filter][show]=approved";
|
||||
} elseif ($serendipity['GET']['filter']['show'] == 'pending') {
|
||||
$and .= "AND status = 'pending'";
|
||||
$searchString .= "&serendipity[filter][show]=pending";
|
||||
} elseif ($serendipity['GET']['filter']['show'] == 'confirm') {
|
||||
$and .= "AND status LIKE 'confirm%'";
|
||||
$searchString .= "&serendipity[filter][show]=confirm";
|
||||
} else {
|
||||
if (! isset($serendipity['GET']['filter']['show'])) {
|
||||
$serendipity['GET']['filter']['show'] = 'all';
|
||||
} else {
|
||||
if ($serendipity['GET']['filter']['show'] == 'approved') {
|
||||
$and .= "AND status = 'approved'";
|
||||
$searchString .= "&serendipity[filter][show]=approved";
|
||||
} elseif ($serendipity['GET']['filter']['show'] == 'pending') {
|
||||
$and .= "AND status = 'pending'";
|
||||
$searchString .= "&serendipity[filter][show]=pending";
|
||||
} elseif ($serendipity['GET']['filter']['show'] == 'confirm') {
|
||||
$and .= "AND status LIKE 'confirm%'";
|
||||
$searchString .= "&serendipity[filter][show]=confirm";
|
||||
}
|
||||
}
|
||||
|
||||
if ($serendipity['GET']['filter']['type'] == 'TRACKBACK') {
|
||||
$c_type = 'TRACKBACK';
|
||||
$searchString .= "&serendipity[filter][type]=TRACKBACK";
|
||||
} elseif ($serendipity['GET']['filter']['type'] == 'PINGBACK') {
|
||||
$c_type = 'PINGBACK';
|
||||
$searchString .= "&serendipity[filter][type]=PINGBACK";
|
||||
} elseif ($serendipity['GET']['filter']['type'] == 'NORMAL') {
|
||||
$c_type = 'NORMAL';
|
||||
$searchString .= "&serendipity[filter][type]=NORMAL";
|
||||
} else {
|
||||
$c_type = null;
|
||||
}
|
||||
|
||||
if ($serendipity['GET']['filter']['type'] == 'TRACKBACK') {
|
||||
$c_type = 'TRACKBACK';
|
||||
$searchString .= "&serendipity[filter][type]=TRACKBACK";
|
||||
} elseif ($serendipity['GET']['filter']['type'] == 'PINGBACK') {
|
||||
$c_type = 'PINGBACK';
|
||||
$searchString .= "&serendipity[filter][type]=PINGBACK";
|
||||
} elseif ($serendipity['GET']['filter']['type'] == 'NORMAL') {
|
||||
$c_type = 'NORMAL';
|
||||
$searchString .= "&serendipity[filter][type]=NORMAL";
|
||||
} else {
|
||||
if (! isset($serendipity['GET']['filter']['type'])) {
|
||||
$c_type = null;
|
||||
} else {
|
||||
if ($serendipity['GET']['filter']['type'] == 'TRACKBACK') {
|
||||
$c_type = 'TRACKBACK';
|
||||
$searchString .= "&serendipity[filter][type]=TRACKBACK";
|
||||
} elseif ($serendipity['GET']['filter']['type'] == 'PINGBACK') {
|
||||
$c_type = 'PINGBACK';
|
||||
$searchString .= "&serendipity[filter][type]=PINGBACK";
|
||||
} elseif ($serendipity['GET']['filter']['type'] == 'NORMAL') {
|
||||
$c_type = 'NORMAL';
|
||||
$searchString .= "&serendipity[filter][type]=NORMAL";
|
||||
}
|
||||
}
|
||||
|
||||
if ($commentsPerPage != 10) {
|
||||
@ -260,7 +257,11 @@ $sql = serendipity_db_query("SELECT COUNT(*) AS total FROM {$serendipity['dbPref
|
||||
|
||||
$totalComments = $sql['total'];
|
||||
$pages = ($commentsPerPage == COMMENTS_FILTER_ALL ? 1 : ceil($totalComments/(int)$commentsPerPage));
|
||||
$page = (int)$serendipity['GET']['page'];
|
||||
if (isset($serendipity['GET']['page'])) {
|
||||
$page = (int)$serendipity['GET']['page'];
|
||||
} else {
|
||||
$page = 0;
|
||||
}
|
||||
if ( $page == 0 || $page > $pages ) {
|
||||
$page = 1;
|
||||
}
|
||||
@ -371,6 +372,7 @@ $data['msg'] = $msg;
|
||||
$data['urltoken'] = serendipity_setFormToken('url');
|
||||
$data['formtoken'] = serendipity_setFormToken();
|
||||
$data['get']['filter'] = $serendipity['GET']['filter']; // don't trust {$smarty.get.vars} if not proofed, as we often change GET vars via serendipty['GET'] by runtime
|
||||
$data['commentReplied'] = false;
|
||||
|
||||
if (!is_object($serendipity['smarty'])) {
|
||||
serendipity_smarty_init();
|
||||
|
@ -8,7 +8,7 @@ if (IN_serendipity !== true) {
|
||||
|
||||
umask(0000);
|
||||
$umask = 0775;
|
||||
@define('IN_installer', true);
|
||||
if (! defined('IN_installer')) { define('IN_installer', true); }
|
||||
|
||||
if (!isset($_POST['installAction'])) {
|
||||
$_POST['installAction'] = '';
|
||||
@ -69,6 +69,10 @@ if (!is_object($serendipity['smarty'])) {
|
||||
serendipity_smarty_init();
|
||||
}
|
||||
|
||||
# php 8 compat section
|
||||
if (! isset($data['installAction'])) { $data['installAction'] = null; }
|
||||
if (! isset($data['adminAction'])) { $data['adminAction'] = null; }
|
||||
|
||||
echo serendipity_smarty_show('admin/configuration.inc.tpl', $data);
|
||||
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
@ -17,7 +17,7 @@ $sort_order = array('timestamp' => DATE,
|
||||
'title' => TITLE,
|
||||
'id' => 'ID');
|
||||
|
||||
$data = array();
|
||||
$data = array('no_entries' => false, 'iframe' => false, 'drawList' => false, 'switched_output' => false);
|
||||
|
||||
if (!empty($serendipity['GET']['editSubmit'])) {
|
||||
$serendipity['GET']['adminAction'] = 'edit'; // does this change smarty.get vars?
|
||||
@ -226,17 +226,17 @@ switch($serendipity['GET']['adminAction']) {
|
||||
$sort_import = array('perPage', 'ordermode', 'order');
|
||||
|
||||
foreach($filter_import AS $f_import) {
|
||||
serendipity_restoreVar($serendipity['COOKIE']['entrylist_filter_' . $f_import], serendipity_specialchars($serendipity['GET']['filter'][$f_import]));
|
||||
$data["get_filter_$f_import"] = serendipity_specialchars($serendipity['GET']['filter'][$f_import]);
|
||||
serendipity_restoreVar($serendipity['COOKIE']['entrylist_filter_' . $f_import], serendipity_specialchars($serendipity['GET']['filter'][$f_import] ?? null));
|
||||
$data["get_filter_$f_import"] = serendipity_specialchars($serendipity['GET']['filter'][$f_import] ?? null);
|
||||
}
|
||||
|
||||
foreach($sort_import AS $s_import) {
|
||||
serendipity_restoreVar($serendipity['COOKIE']['entrylist_sort_' . $s_import], serendipity_specialchars($serendipity['GET']['sort'][$s_import]));
|
||||
$data["get_sort_$s_import"] = serendipity_specialchars($serendipity['GET']['sort'][$s_import]);
|
||||
serendipity_restoreVar($serendipity['COOKIE']['entrylist_sort_' . $s_import], serendipity_specialchars($serendipity['GET']['sort'][$s_import] ?? null));
|
||||
$data["get_sort_$s_import"] = serendipity_specialchars($serendipity['GET']['sort'][$s_import] ?? null);
|
||||
}
|
||||
|
||||
$perPage = (!empty($serendipity['GET']['sort']['perPage']) ? $serendipity['GET']['sort']['perPage'] : $per_page[0]);
|
||||
$page = (int)$serendipity['GET']['page'];
|
||||
$page = (int)($serendipity['GET']['page'] ?? 0);
|
||||
$offSet = $perPage*$page;
|
||||
|
||||
if (empty($serendipity['GET']['sort']['ordermode']) || $serendipity['GET']['sort']['ordermode'] != 'ASC') {
|
||||
@ -330,7 +330,7 @@ switch($serendipity['GET']['adminAction']) {
|
||||
$data['page'] = $page;
|
||||
|
||||
$data['totalEntries'] = serendipity_getTotalEntries();
|
||||
$data['simpleFilters'] = $serendipity['simpleFilters'];
|
||||
$data['simpleFilters'] = $serendipity['simpleFilters'] ?? null;
|
||||
|
||||
if (is_array($entries)) {
|
||||
$data['is_entries'] = true;
|
||||
@ -340,8 +340,10 @@ switch($serendipity['GET']['adminAction']) {
|
||||
foreach ((array)$serendipity['GET']['sort'] as $k => $v) {
|
||||
$qString .= '&serendipity[sort]['. $k .']='. $v;
|
||||
}
|
||||
foreach ((array)$serendipity['GET']['filter'] as $k => $v) {
|
||||
$qString .= '&serendipity[filter]['. $k .']='. $v;
|
||||
if (isset($serendipity['GET']['filter'])) {
|
||||
foreach ((array)$serendipity['GET']['filter'] as $k => $v) {
|
||||
$qString .= '&serendipity[filter]['. $k .']='. $v;
|
||||
}
|
||||
}
|
||||
$data['linkFirst'] = $qString . '&serendipity[page]=' . 0;
|
||||
$data['linkPrevious'] = $qString . '&serendipity[page]=' . ($page-1);
|
||||
@ -365,7 +367,7 @@ switch($serendipity['GET']['adminAction']) {
|
||||
'timestamp' => (int)$ey['timestamp'],
|
||||
'last_modified' => (int)$ey['last_modified'],
|
||||
'isdraft' => serendipity_db_bool($ey['isdraft']),
|
||||
'ep_is_sticky' => (serendipity_db_bool($ey['properties']['ep_is_sticky']) ? true : false),
|
||||
'ep_is_sticky' => (serendipity_db_bool($ey['properties']['ep_is_sticky'] ?? null) ? true : false),
|
||||
'pubdate' => date("c", (int)$ey['timestamp']),
|
||||
'author' => serendipity_specialchars($ey['author']),
|
||||
'cats' => $entry_cats,
|
||||
@ -439,16 +441,17 @@ switch($serendipity['GET']['adminAction']) {
|
||||
'serendipity[adminModule]' => 'entries',
|
||||
'serendipity[adminAction]' => 'save'
|
||||
),
|
||||
(isset($entry) ? $entry : array())
|
||||
(isset($entry) ? $entry : array('entry_form' => null, 'id' => null, 'body' => null, 'extended' => null))
|
||||
);
|
||||
}
|
||||
|
||||
$data['entryForm'] = $entryForm;
|
||||
$data['errors'] = $errors;
|
||||
$data['entryForm'] = $entryForm ?? null;
|
||||
$data['errors'] = $errors ?? null;
|
||||
$data['get'] = $serendipity['GET']; // don't trust {$smarty.get.vars} if not proofed, as we often change GET vars via serendipty['GET'] by runtime
|
||||
// make sure we've got these
|
||||
if (!isset($data['urltoken'])) $data['urltoken'] = serendipity_setFormToken('url');
|
||||
if (!isset($data['formtoken'])) $data['formtoken'] = serendipity_setFormToken();
|
||||
if (!isset($data['urltoken'])) { $data['urltoken'] = serendipity_setFormToken('url'); }
|
||||
if (!isset($data['formtoken'])) { $data['formtoken'] = serendipity_setFormToken(); }
|
||||
if (!isset($data['get']['filter'])) { $data['get']['filter'] = []; }
|
||||
|
||||
echo serendipity_smarty_show('admin/entries.inc.tpl', $data);
|
||||
|
||||
|
@ -124,6 +124,13 @@ if ($serendipity['GET']['adminAction'] == 'edit' || isset($_POST['NEW']) || $ser
|
||||
$data['formToken'] = serendipity_setFormToken();
|
||||
}
|
||||
|
||||
# php 8 compat section
|
||||
if (! isset($data['delete_yes'])) { $data['delete_yes'] = null; }
|
||||
if (! isset($data['save_new'])) { $data['save_new'] = null; }
|
||||
if (! isset($data['save_edit'])) { $data['save_edit'] = null; }
|
||||
if (! isset($data['edit'])) { $data['edit'] = null; }
|
||||
if (! isset($data['new'])) { $data['new'] = null; }
|
||||
|
||||
echo serendipity_smarty_show('admin/groups.inc.tpl', $data);
|
||||
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
@ -20,13 +20,6 @@ if (!is_object($serendipity['smarty'])) {
|
||||
if (!is_array($serendipity['POST']) && $serendipity['GET']['adminAction'] == 'multicheck') {
|
||||
unset($serendipity['GET']['adminAction']);
|
||||
}
|
||||
// Listens on toggle_dir STRICT to list items per directory, or include all sub directory items
|
||||
if (empty($serendipity['GET']['toggle_dir']) && empty($serendipity['COOKIE']['serendipity_toggle_dir'])) {
|
||||
$serendipity['GET']['toggle_dir'] = 'no'; // default
|
||||
}
|
||||
if (!empty($serendipity['COOKIE']['serendipity_toggle_dir'])) {
|
||||
serendipity_restoreVar($serendipity['COOKIE']['serendipity_toggle_dir'], $serendipity['GET']['toggle_dir']);
|
||||
}
|
||||
|
||||
$messages = array();
|
||||
|
||||
@ -40,6 +33,27 @@ if ( $serendipity['GET']['adminAction'] == 'add' && !$serendipity['POST']['admin
|
||||
}
|
||||
}
|
||||
|
||||
# php 8 compat array field initialization
|
||||
$data['case_doSync'] = false;
|
||||
$data['case_do_delete'] = false;
|
||||
$data['case_do_multidelete'] = false;
|
||||
$data['case_multidelete'] = false;
|
||||
$data['case_delete'] = false;
|
||||
$data['case_add'] = false;
|
||||
$data['case_directoryDoDelete'] = false;
|
||||
$data['case_directoryEdit'] = false;
|
||||
$data['case_directoryDelete'] = false;
|
||||
$data['case_directoryDoCreate'] = false;
|
||||
$data['case_directoryCreate'] = false;
|
||||
$data['case_addSelect'] = false;
|
||||
$data['case_rotateCW'] = false;
|
||||
$data['case_rotateCCW'] = false;
|
||||
$data['case_scale'] = false;
|
||||
$data['case_scaleSelect'] = false;
|
||||
$data['case_default'] = false;
|
||||
$data['showMLbutton'] = false;
|
||||
$data['case_directorySelect'] = false;
|
||||
|
||||
switch ($serendipity['GET']['adminAction']) {
|
||||
|
||||
case 'doSync':
|
||||
@ -322,12 +336,12 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
|
||||
// Insert into database
|
||||
$image_id = serendipity_insertImageInDatabase($tfile, $serendipity['POST']['target_directory'][$tindex], $authorid, null, $realname);
|
||||
serendipity_plugin_api::hook_event('backend_image_add', $target, array('image_id' => $image_id));
|
||||
$new_media[] = array(
|
||||
'image_id' => $image_id,
|
||||
'target' => $target,
|
||||
'created_thumbnail' => $created_thumbnail
|
||||
);
|
||||
serendipity_plugin_api::hook_event('backend_image_add', $target, $new_media);
|
||||
}
|
||||
}
|
||||
serendipity_request_end();
|
||||
@ -407,12 +421,12 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
|
||||
// Insert into database
|
||||
$image_id = serendipity_insertImageInDatabase($tfile, $serendipity['POST']['target_directory'][$idx], $authorid, null, $realname);
|
||||
serendipity_plugin_api::hook_event('backend_image_add', $target, $created_thumbnail);
|
||||
$new_media[] = array(
|
||||
'image_id' => $image_id,
|
||||
'target' => $target,
|
||||
'created_thumbnail' => $created_thumbnail
|
||||
);
|
||||
serendipity_plugin_api::hook_event('backend_image_add', $target, $new_media);
|
||||
} else {
|
||||
// necessary for the ajax-uplaoder to show upload errors
|
||||
header("Internal Server Error", true, 500);
|
||||
@ -810,8 +824,9 @@ if (! isset($data['showML'])) {
|
||||
}
|
||||
}
|
||||
|
||||
$data['get']['fid'] = $serendipity['GET']['fid']; // don't trust {$smarty.get.vars} if not proofed, as we often change GET vars via serendipty['GET'] by runtime
|
||||
$data['get']['only_path'] = $serendipity['GET']['only_path'];
|
||||
$data['get']['fid'] = $serendipity['GET']['fid'] ?? null; // don't trust {$smarty.get.vars} if not proofed, as we often change GET vars via serendipty['GET'] by runtime
|
||||
$data['get']['only_path'] = $serendipity['GET']['only_path'] ?? null;
|
||||
if (! isset($data['messages'])) { $data['messages'] = []; }
|
||||
|
||||
echo serendipity_smarty_show('admin/images.inc.tpl', $data);
|
||||
|
||||
|
@ -230,6 +230,7 @@ if (isset($serendipity['GET']['importFrom']) && serendipity_checkFormToken()) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$data['importForm'] = false;
|
||||
$importpath = S9Y_INCLUDE_PATH . 'include/admin/importers/';
|
||||
$dir = opendir($importpath);
|
||||
$list = array();
|
||||
|
@ -8,6 +8,10 @@ include S9Y_INCLUDE_PATH . 'include/admin/import.inc.php';
|
||||
$data['importMenu'] = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
if (! isset($_POST['adminAction'])) {
|
||||
$_POST['adminAction'] = null;
|
||||
}
|
||||
|
||||
if ($_POST['adminAction'] == "maintenanceMode") {
|
||||
if (serendipity_db_bool(serendipity_get_config_var("maintenanceMode", false)) === true) {
|
||||
serendipity_set_config_var("maintenanceMode", false);
|
||||
@ -58,9 +62,18 @@ switch($serendipity['GET']['adminAction']) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$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_active'] = $data['maintenance_mode'] && time() < serendipity_get_config_var("maintenanceModeEnd", 0);
|
||||
|
||||
# php 8 compat section
|
||||
if (! isset($data['action'])) { $data['action'] = null; }
|
||||
if (! isset($data['cleanup_finish'])) { $data['cleanup_finish'] = null; }
|
||||
if (! isset($data['cleanup_template'])) { $data['cleanup_template'] = null; }
|
||||
|
||||
|
||||
echo serendipity_smarty_show('admin/maintenance.inc.tpl', $data);
|
||||
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
@ -7,7 +7,7 @@ if (IN_serendipity !== true) {
|
||||
global $serendipity;
|
||||
$data = array();
|
||||
|
||||
switch($serendipity['POST']['adminAction']) {
|
||||
switch($serendipity['POST']['adminAction'] ?? '') {
|
||||
case 'publish':
|
||||
if (!serendipity_checkFormToken()) {
|
||||
break;
|
||||
@ -19,8 +19,10 @@ switch($serendipity['POST']['adminAction']) {
|
||||
));
|
||||
if (is_numeric($success)) {
|
||||
$data['published'] = $success;
|
||||
$data['error_publish'] = false;
|
||||
} else {
|
||||
$data['error_publish'] = $success;
|
||||
$data['published'] = false;
|
||||
}
|
||||
break;
|
||||
case 'updateCheckDisable':
|
||||
@ -29,6 +31,10 @@ switch($serendipity['POST']['adminAction']) {
|
||||
}
|
||||
serendipity_set_config_var('updateCheck', false);
|
||||
break;
|
||||
default:
|
||||
$data['published'] = false;
|
||||
$data['error_publish'] = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -43,7 +49,7 @@ $data['js_failure_file'] = serendipity_getTemplateFile('admin/serendipity_editor
|
||||
|
||||
$output = array();
|
||||
serendipity_plugin_api::hook_event('backend_frontpage_display', $output);
|
||||
$data['backend_frontpage_display'] = $output['more'];
|
||||
$data['backend_frontpage_display'] = $output['more'] ?? null;
|
||||
|
||||
$data['usedVersion'] = $serendipity['version'];
|
||||
$data['updateCheck'] = $serendipity['updateCheck'];
|
||||
@ -87,6 +93,8 @@ if (is_array($comments) && count($comments) > 0) {
|
||||
// When summary is not the full body, strip HTML tags from summary, as it might break and leave unclosed HTML.
|
||||
$comment['fullBody'] = nl2br(serendipity_specialchars($comment['fullBody']));
|
||||
$comment['summary'] = nl2br(strip_tags($comment['summary']));
|
||||
} else {
|
||||
$comment['excerpt'] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -144,7 +152,7 @@ $data['entries'] = $entries;
|
||||
$data['urltoken'] = serendipity_setFormToken('url');
|
||||
$data['token'] = serendipity_setFormToken();
|
||||
|
||||
$data['no_create'] = $serendipity['no_create'];
|
||||
$data['no_create'] = $serendipity['no_create'] ?? null;
|
||||
|
||||
echo serendipity_smarty_show('admin/overview.inc.tpl', $data);
|
||||
|
||||
|
@ -120,6 +120,9 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
$plugin->cleanup();
|
||||
}
|
||||
|
||||
$data['save_errors'] = null;
|
||||
$data['saveconf'] = null;
|
||||
$data['timestamp'] = null;
|
||||
if ( isset($save_errors) && is_array($save_errors) && count($save_errors) > 0 ) {
|
||||
$data['save_errors'] = $save_errors;
|
||||
} elseif ( isset($_POST['SAVECONF'])) {
|
||||
@ -137,6 +140,7 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
$data['changelog'] = true;
|
||||
}
|
||||
|
||||
$data['documentation_local'] = null;
|
||||
if (@file_exists(dirname($plugin->pluginFile) . '/documentation_' . $serendipity['lang'] . '.html')) {
|
||||
$data['documentation_local'] = '/documentation_' . $serendipity['lang'] . '.html';
|
||||
} elseif (@file_exists(dirname($plugin->pluginFile) . '/documentation_en.html')) {
|
||||
@ -479,13 +483,24 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
|
||||
$data['event_plugins'] = show_plugins(true);
|
||||
|
||||
if ($serendipity['memSnaps'] && count($serendipity['memSnaps']) > 0) {
|
||||
if (isset($serendipity['memSnaps']) && $serendipity['memSnaps'] && count($serendipity['memSnaps']) > 0) {
|
||||
$data['$memsnaps'] = $serendipity['memSnaps'];
|
||||
} else {
|
||||
$data['$memsnaps'] = null;
|
||||
}
|
||||
|
||||
$data['updateAllMsg'] = isset($serendipity['GET']['updateAllMsg']);
|
||||
}
|
||||
|
||||
$data['urltoken'] = serendipity_setFormToken('url');
|
||||
|
||||
# php 8 compat section
|
||||
if (! isset($data['plugin_to_conf'])) { $data['plugin_to_conf'] = null; }
|
||||
if (! isset($data['adminAction'])) { $data['adminAction'] = null; }
|
||||
if (! isset($data['new_plugin_failed'])) { $data['new_plugin_failed'] = null; }
|
||||
if (! isset($data['save'])) { $data['save'] = null; }
|
||||
if (! isset($data['memsnaps'])) { $data['memsnaps'] = null; }
|
||||
|
||||
echo serendipity_smarty_show('admin/plugins.inc.tpl', $data);
|
||||
|
||||
|
||||
|
@ -131,7 +131,7 @@ if (is_array($template_config)) {
|
||||
serendipity_plugin_api::hook_event('backend_templates_configuration_top', $template_config);
|
||||
$data["has_config"] = true;
|
||||
|
||||
if ($serendipity['POST']['adminAction'] == 'configure' && serendipity_checkFormToken()) {
|
||||
if (isset($serendipity['POST']['adminAction']) && $serendipity['POST']['adminAction'] == 'configure' && serendipity_checkFormToken()) {
|
||||
$storage = new template_option();
|
||||
$storage->import($template_config);
|
||||
foreach($serendipity['POST']['template'] AS $option => $value) {
|
||||
@ -184,7 +184,7 @@ ksort($stack);
|
||||
|
||||
foreach ($stack as $theme => $info) {
|
||||
/* Sorry, but we don't display engines */
|
||||
if ( strtolower($info['engine']) == 'yes') {
|
||||
if ( isset($info['engine']) && strtolower($info['engine']) == 'yes') {
|
||||
continue;
|
||||
}
|
||||
$data['templates'][$theme]['info'] = $info;
|
||||
@ -209,11 +209,13 @@ foreach ($stack as $theme => $info) {
|
||||
if (file_exists($serendipity["serendipityPath"] . $serendipity["templatePath"] . $theme . "/preview${backendId}${previewType}")) {
|
||||
$data["templates"][$theme]["preview${backendId}"] = $serendipity["templatePath"] . $theme . "/preview${backendId}${previewType}";
|
||||
} elseif (!empty($info["previewURL"])) {
|
||||
$data["templates"][$theme]["preview${backendId}"] = $info["previewURL${backendId}"] ;
|
||||
$data["templates"][$theme]["preview${backendId}"] = $info["previewURL${backendId}"] ?? null;
|
||||
}
|
||||
|
||||
if ($info['demoURL']) {
|
||||
if (isset($info['demoURL']) && $info['demoURL']) {
|
||||
$data['templates'][$theme]['demoURL'] = $info['demoURL'];
|
||||
} else {
|
||||
$data['templates'][$theme]['demoURL'] = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -223,7 +225,7 @@ foreach ($stack as $theme => $info) {
|
||||
$data['templates'][$theme]['unmetRequirements'] = sprintf(UNMET_REQUIREMENTS, implode(', ', $unmetRequirements));
|
||||
}
|
||||
|
||||
if ($info['recommended']) {
|
||||
if (isset($info['recommended']) && $info['recommended']) {
|
||||
$data['recommended_templates'][$theme] = $data['templates'][$theme];
|
||||
if ($theme != $serendipity['template'] && $theme != $serendipity['template_backend']) {
|
||||
unset($data['templates'][$theme]);
|
||||
@ -246,6 +248,10 @@ if ($serendipity['template'] != $serendipity['template_backend'] && isset($data[
|
||||
}
|
||||
unset($data['recommended_templates'][$serendipity['template']]);
|
||||
|
||||
# php 8 compat section
|
||||
if (! isset($data['adminAction'])) { $data['adminAction'] = null; }
|
||||
if (! isset($data['deprecated'])) { $data['deprecated'] = null; }
|
||||
|
||||
echo serendipity_smarty_show('admin/templates.inc.tpl', $data);
|
||||
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
@ -245,6 +245,13 @@ if ( ($serendipity['GET']['adminAction'] == 'edit' && serendipity_checkPermissio
|
||||
}
|
||||
}
|
||||
|
||||
# php 8 compat section
|
||||
if (! isset($data['delete_yes'])) { $data['delete_yes'] = null; }
|
||||
if (! isset($data['save_new'])) { $data['save_new'] = null; }
|
||||
if (! isset($data['save_edit'])) { $data['save_edit'] = null; }
|
||||
if (! isset($data['show_form'])) { $data['show_form'] = null; }
|
||||
|
||||
|
||||
echo serendipity_smarty_show('admin/users.inc.tpl', $data);
|
||||
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
Loading…
x
Reference in New Issue
Block a user