trackback 1.20.1: PHP 8 compatibility fixes
This commit is contained in:
parent
11519fe118
commit
56429d1eb6
|
@ -1,3 +1,7 @@
|
||||||
|
1.20.1:
|
||||||
|
-----
|
||||||
|
* PHP 8 compatibility fixes
|
||||||
|
|
||||||
1.20:
|
1.20:
|
||||||
-----
|
-----
|
||||||
* Fix draft check.
|
* Fix draft check.
|
||||||
|
|
|
@ -19,7 +19,7 @@ class serendipity_event_trackback extends serendipity_event
|
||||||
$propbag->add('description', PLUGIN_EVENT_MTRACKBACK_TITLEDESC);
|
$propbag->add('description', PLUGIN_EVENT_MTRACKBACK_TITLEDESC);
|
||||||
$propbag->add('stackable', false);
|
$propbag->add('stackable', false);
|
||||||
$propbag->add('author', 'Garvin Hicking, Malte Paskuda, Ian');
|
$propbag->add('author', 'Garvin Hicking, Malte Paskuda, Ian');
|
||||||
$propbag->add('version', '1.20');
|
$propbag->add('version', '1.20.1');
|
||||||
$propbag->add('requirements', array(
|
$propbag->add('requirements', array(
|
||||||
'serendipity' => '1.6',
|
'serendipity' => '1.6',
|
||||||
'smarty' => '2.6.7',
|
'smarty' => '2.6.7',
|
||||||
|
@ -120,17 +120,19 @@ class serendipity_event_trackback extends serendipity_event
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'backend_trackbacks':
|
case 'backend_trackbacks':
|
||||||
if (!isset($serendipity['POST']['enable_trackback']) && serendipity_db_bool($this->get_config('disable_trackall', 'false'))) {
|
if (!isset($serendipity['POST']['enable_trackback']) &&
|
||||||
|
serendipity_db_bool($this->get_config('disable_trackall', 'false'))) {
|
||||||
$serendipity['noautodiscovery'] = true;
|
$serendipity['noautodiscovery'] = true;
|
||||||
} elseif ($serendipity['POST']['enable_trackback'] == 'off') {
|
} elseif (($serendipity['POST']['enable_trackback'] ?? null) == 'off') {
|
||||||
$serendipity['noautodiscovery'] = true;
|
$serendipity['noautodiscovery'] = true;
|
||||||
} else {
|
} else {
|
||||||
if ($serendipity['POST']['enable_trackback'] == 'selective') {
|
if (($serendipity['POST']['enable_trackback'] ?? null) == 'selective') {
|
||||||
// Clear TB URLs from the entry, start afresh from the textarea input.
|
// Clear TB URLs from the entry, start afresh from the textarea input.
|
||||||
$eventData = array();
|
$eventData = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($serendipity['POST']['additional_trackbacks'])) {
|
if (isset($serendipity['POST']['additional_trackbacks']) &&
|
||||||
|
!empty($serendipity['POST']['additional_trackbacks'])) {
|
||||||
$trackbackURLs = preg_split('@[ \s]+@', trim($serendipity['POST']['additional_trackbacks']));
|
$trackbackURLs = preg_split('@[ \s]+@', trim($serendipity['POST']['additional_trackbacks']));
|
||||||
foreach($trackbackURLs AS $trackbackURL) {
|
foreach($trackbackURLs AS $trackbackURL) {
|
||||||
$trackbackURL = trim($trackbackURL);
|
$trackbackURL = trim($trackbackURL);
|
||||||
|
@ -263,6 +265,10 @@ class serendipity_event_trackback extends serendipity_event
|
||||||
include_once S9Y_INCLUDE_PATH . 'include/functions_trackbacks.inc.php';
|
include_once S9Y_INCLUDE_PATH . 'include/functions_trackbacks.inc.php';
|
||||||
|
|
||||||
$stored_entry = serendipity_fetchEntry('id', $entry['id'], 1, 1);
|
$stored_entry = serendipity_fetchEntry('id', $entry['id'], 1, 1);
|
||||||
|
if ($stored_entry == false) {
|
||||||
|
// The entry must have been deleted
|
||||||
|
$this->removeDelayed($entry['id']);
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($_SESSION['serendipityRightPublish'])) {
|
if (isset($_SESSION['serendipityRightPublish'])) {
|
||||||
$oldPublighRights = $_SESSION['serendipityRightPublish'];
|
$oldPublighRights = $_SESSION['serendipityRightPublish'];
|
||||||
|
@ -284,7 +290,6 @@ class serendipity_event_trackback extends serendipity_event
|
||||||
foreach($current_cat AS $categoryidx => $category_data) {
|
foreach($current_cat AS $categoryidx => $category_data) {
|
||||||
$stored_entry['categories'][$category_data['categoryid']] = $category_data['categoryid'];
|
$stored_entry['categories'][$category_data['categoryid']] = $category_data['categoryid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
serendipity_updertEntry($stored_entry);
|
serendipity_updertEntry($stored_entry);
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
@ -294,7 +299,7 @@ class serendipity_event_trackback extends serendipity_event
|
||||||
} else {
|
} else {
|
||||||
$_SESSION['serendipityRightPublish'] = $oldPublighRights;
|
$_SESSION['serendipityRightPublish'] = $oldPublighRights;
|
||||||
}
|
}
|
||||||
#the trackbacks are now generated
|
# the trackbacks are now generated
|
||||||
$this->removeDelayed($entry['id']);
|
$this->removeDelayed($entry['id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -313,12 +318,8 @@ class serendipity_event_trackback extends serendipity_event
|
||||||
function setupDB()
|
function setupDB()
|
||||||
{
|
{
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
// postgres < 9.3 IF NOT EXISTS workaround...
|
|
||||||
$c = serendipity_db_query("SELECT COUNT(*) FROM {$serendipity['dbPrefix']}delayed_trackbacks;");
|
$sql = "CREATE TABLE IF NOT EXISTS {$serendipity['dbPrefix']}delayed_trackbacks (
|
||||||
if (is_numeric($c)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$sql = "CREATE TABLE {$serendipity['dbPrefix']}delayed_trackbacks (
|
|
||||||
id int(11) NOT NULL {PRIMARY},
|
id int(11) NOT NULL {PRIMARY},
|
||||||
timestamp int(10) {UNSIGNED}
|
timestamp int(10) {UNSIGNED}
|
||||||
)";
|
)";
|
||||||
|
|
Loading…
Reference in a new issue