1
0

php 8 compat fixes for receiving trackbacks

This commit is contained in:
onli
2021-05-25 23:13:51 +02:00
parent 42f93ee27a
commit 730f4c080a
4 changed files with 6 additions and 5 deletions

View File

@ -83,7 +83,6 @@ if (!($type = @$_REQUEST['type'])) {
if ($type == 'trackback') { if ($type == 'trackback') {
if ($tb_logging) { if ($tb_logging) {
# PHP 4.2.2 way of doing things
ob_start(); ob_start();
print_r($_REQUEST); print_r($_REQUEST);
$tmp = ob_get_contents(); $tmp = ob_get_contents();

View File

@ -705,6 +705,9 @@ function serendipity_approveComment($cid, $entry_id, $force = false, $moderate =
if (! is_array($counter_tb)) { if (! is_array($counter_tb)) {
$counter_tb = ['counter' => 0]; $counter_tb = ['counter' => 0];
} }
if (! is_array($counter_comments)) {
$counter_comments = ['counter' => 0];
}
$query = "UPDATE {$serendipity['dbPrefix']}entries $query = "UPDATE {$serendipity['dbPrefix']}entries
SET comments = " . (int)$counter_comments['counter'] . ", SET comments = " . (int)$counter_comments['counter'] . ",
@ -1008,7 +1011,7 @@ function serendipity_saveComment($id, $commentInfo, $type = 'NORMAL', $source =
$commentInfo['source'] = $source; $commentInfo['source'] = $source;
// Secure email addresses, only one [first] allowed to not mail to multiple recipients // Secure email addresses, only one [first] allowed to not mail to multiple recipients
$mailparts = explode(',', $commentInfo['email']); $mailparts = explode(',', $commentInfo['email'] ?? '');
$commentInfo['email'] = trim($mailparts[0]); $commentInfo['email'] = trim($mailparts[0]);
serendipity_plugin_api::hook_event('frontend_saveComment', $ca, $commentInfo); serendipity_plugin_api::hook_event('frontend_saveComment', $ca, $commentInfo);

View File

@ -1039,7 +1039,7 @@ function serendipity_smarty_init($vars = array()) {
if (defined('IN_serendipity_admin') && array_key_exists('wysiwyg', $serendipity) && $serendipity['wysiwyg']) { if (defined('IN_serendipity_admin') && array_key_exists('wysiwyg', $serendipity) && $serendipity['wysiwyg']) {
// backwards compatibility with removed force-settings // backwards compatibility with removed force-settings
if (strpos($serendipity['wysiwygToolbar'], 'NOCC-') !== false) { if (strpos($serendipity['wysiwygToolbar'], 'NOCC-') !== false) {
$serendipity['wysiwygToolbar'] = substr($serendipity['wysiwygToolbar'], 5); $serendipity['wysiwygToolbar'] = substr($serendipity['wysiwygToolbar'], 5);
} }
@ -1050,7 +1050,6 @@ function serendipity_smarty_init($vars = array()) {
// check ckeditor custom config file // check ckeditor custom config file
$ccc = serendipity_getTemplateFile('admin/ckeditor_custom_config.js', 'serendipityHTTPPath', true); $ccc = serendipity_getTemplateFile('admin/ckeditor_custom_config.js', 'serendipityHTTPPath', true);
$wysiwyg_customConfig = (!empty($ccc)) ? $ccc : $serendipity['serendipityHTTPPath'] . 'htmlarea/ckeditor_s9y_config.js'; $wysiwyg_customConfig = (!empty($ccc)) ? $ccc : $serendipity['serendipityHTTPPath'] . 'htmlarea/ckeditor_s9y_config.js';
} }
if (array_key_exists('enableBackendPopupGranular', $serendipity)) { if (array_key_exists('enableBackendPopupGranular', $serendipity)) {

View File

@ -351,7 +351,7 @@ function add_trackback($id, $title, $url, $name, $excerpt) {
// Decode HTML Entities // Decode HTML Entities
$excerpt = trackback_body_strip($excerpt); $excerpt = trackback_body_strip($excerpt);
if ($tb_logging) { if ($GLOBALS['tb_logging']) {
$fp = fopen('trackback2.log', 'a'); $fp = fopen('trackback2.log', 'a');
fwrite($fp, '[' . date('d.m.Y H:i') . '] Trackback body:' . $excerpt . "\n"); fwrite($fp, '[' . date('d.m.Y H:i') . '] Trackback body:' . $excerpt . "\n");
fclose($fp); fclose($fp);