Skip to content

Commit 6b6f951

Browse files
authored
Merge branch 'master' into feature/dropE_STRICT
2 parents 4b7dcf3 + a6619f7 commit 6b6f951

File tree

11 files changed

+35
-22
lines changed

11 files changed

+35
-22
lines changed

.github/workflows/php_tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
# for available versions see https://github.com/marketplace/actions/setup-php-action#tada-php-support
2020
strategy:
2121
matrix:
22-
phpversion: ['7.4', '8.1', '8.2', '8.3']
22+
phpversion: ['7.4', '8.1', '8.2', '8.3', '8.4']
2323

2424
steps:
2525
- uses: actions/checkout@v4

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ DEADJOE
2020
*.git
2121
tests/phpunit.xml
2222
vagrant/*
23+
*.orig

bundled-libs/XML/RPC.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ function parseResponse($data = '')
14331433

14341434
$encoding = $this->getEncoding($data);
14351435
$parser_resource = xml_parser_create($encoding);
1436-
$parser = (int) $parser_resource;
1436+
$parser = 1;
14371437

14381438
$XML_RPC_xh = array();
14391439
$XML_RPC_xh[$parser] = array();
@@ -1590,7 +1590,7 @@ function addScalar($val, $type = 'string')
15901590
}
15911591
$typeof = $GLOBALS['XML_RPC_Types'][$type];
15921592
if ($typeof != 1) {
1593-
$this->raiseError("Not a scalar type (${typeof})",
1593+
$this->raiseError("Not a scalar type ({$typeof})",
15941594
XML_RPC_ERROR_INVALID_TYPE);
15951595
return 0;
15961596
}
@@ -1723,16 +1723,16 @@ function serializedata($typ, $val)
17231723
case 1:
17241724
switch ($typ) {
17251725
case $GLOBALS['XML_RPC_Base64']:
1726-
$rs .= "<${typ}>" . base64_encode($val) . "</${typ}>";
1726+
$rs .= "<{$typ}>" . base64_encode($val) . "</{$typ}>";
17271727
break;
17281728
case $GLOBALS['XML_RPC_Boolean']:
1729-
$rs .= "<${typ}>" . ($val ? '1' : '0') . "</${typ}>";
1729+
$rs .= "<{$typ}>" . ($val ? '1' : '0') . "</{$typ}>";
17301730
break;
17311731
case $GLOBALS['XML_RPC_String']:
1732-
$rs .= "<${typ}>" . serendipity_specialchars($val). "</${typ}>";
1732+
$rs .= "<{$typ}>" . serendipity_specialchars($val). "</{$typ}>";
17331733
break;
17341734
default:
1735-
$rs .= "<${typ}>${val}</${typ}>";
1735+
$rs .= "<{$typ}>{$val}</{$typ}>";
17361736
}
17371737
}
17381738
return $rs;

docs/NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Version 2.6-alpha1 ()
33

44
* PHP 8.4 fix: Remove deprecated constant E_STRICT
55

6+
* PHP 8 compatibility fixes for bundled XML/RPC.php
7+
8+
* Upgrade bundled jQuery to jQuery 3
9+
610
* Fix option to set a different theme as fallback option by setting
711
Engine: $themename in a themes info.txt
812

include/admin/maintenance.inc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666

6767
$data['maintenance_mode'] = serendipity_db_bool(serendipity_get_config_var("maintenanceMode", false));
68-
$data['maintenance_mode_end'] = strftime('%d.%m.%y %T', serendipity_get_config_var("maintenanceModeEnd"));
68+
$data['maintenance_mode_end'] = serendipity_strftime('%d.%m.%y %T', serendipity_get_config_var("maintenanceModeEnd"));
6969
$data['maintenance_mode_active'] = $data['maintenance_mode'] && time() < serendipity_get_config_var("maintenanceModeEnd", 0);
7070

7171
# php 8 compat section

include/functions_calendars.inc.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ function persian_strftime_utf($format, $timestamp='') {
218218
if(date('a',$timestamp)=='pm') $output_str.='بعد از ظهر'; else $output_str.='قبل از ظهر';
219219
break;
220220
case 'R':
221-
$output_str.=strftime('%R', $timestamp);
221+
$output_str.=PHP81_BC\strftime('%R', $timestamp);
222222
break;
223223
case 'S':
224224
$output_str.=date('s', $timestamp);
@@ -251,7 +251,7 @@ function persian_strftime_utf($format, $timestamp='') {
251251
break;
252252
case 'z':
253253
case 'Z':
254-
$output_str.=strftime('%z', $timestamp);
254+
$output_str.=PHP81_BC\strftime('%z', $timestamp);
255255
break;
256256
case '%':
257257
$output_str.='%';

include/plugin_api.inc.php

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ function serendipity_plugin_api_frontend_header($event_name, &$bag, &$eventData,
6767
if (!$check && $serendipity['capabilities']['jquery']) {
6868
?>
6969
<script src="<?php echo $serendipity['serendipityHTTPPath']; ?>templates/jquery.js"></script>
70+
<script src="<?php echo $serendipity['serendipityHTTPPath']; ?>templates/jquery-migrate.js"></script>
7071
<?php
7172
if ($serendipity['capabilities']['jquery-noconflict']) {
7273
?>
@@ -88,6 +89,7 @@ function serendipity_plugin_api_backend_header($event_name, &$bag, &$eventData,
8889
if (!$check && $serendipity['capabilities']['jquery_backend']) {
8990
?>
9091
<script src="<?php echo $serendipity['serendipityHTTPPath']; ?>templates/jquery.js"></script>
92+
<script src="<?php echo $serendipity['serendipityHTTPPath']; ?>templates/jquery-migrate.js"></script>
9193
<?php
9294
}
9395
}
@@ -1315,6 +1317,7 @@ static function load_language($path) {
13151317
if (file_exists($probelang)) {
13161318
include $probelang;
13171319
}
1320+
13181321
include $path . '/lang_en.inc.php';
13191322
error_reporting($oldReportingLevel);
13201323
}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
2.0.1:
2+
* Fix one PHP 8 warning
3+
* Fix error when opening entries in blogs that had the prior version installed
4+
* Link to textile-lang.com to explain the syntax below the comment form, instead of defunct
5+
sites
6+
17
2.0: Remove old textile parsers and switch to netcarver/textile v4.1.3
28
This will improve compatibility with current PHP version (8.x).

plugins/serendipity_event_textile/serendipity_event_textile.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function introspect(&$propbag)
1919
$propbag->add('description', PLUGIN_EVENT_TEXTILE_DESC);
2020
$propbag->add('stackable', false);
2121
$propbag->add('author', 'Serendipity Team', 'Lars Strojny');
22-
$propbag->add('version', '2.0');
22+
$propbag->add('version', '2.0.1');
2323
$propbag->add('requirements', array(
2424
'serendipity' => '1.6',
2525
'smarty' => '2.6.7',
@@ -112,6 +112,9 @@ function introspect_config_item($name, &$propbag)
112112
$propbag->add('description', PLUGIN_EVENT_TEXTILE_UNESCAPE_DESC);
113113
$propbag->add('default', 'false');
114114
break;
115+
case 'textile_version':
116+
// For backwards compatibility, otherwise the constant call below will die
117+
break;
115118

116119
default:
117120
$propbag->add('type', 'boolean');
@@ -165,7 +168,7 @@ function event_hook($event, &$bag, &$eventData, $addData = null)
165168

166169
/* textile it */
167170

168-
if (serendipity_db_bool($this->get_config('unescape'))) {
171+
if (serendipity_db_bool($this->get_config('unescape')) && isset($eventData[$element])) {
169172
$eventData[$element] = str_replace('&quot;', '"', $eventData[$element]);
170173
}
171174
$eventData[$element] = $this->textile($eventData[$element] ?? null);
@@ -200,11 +203,8 @@ function event_hook($event, &$bag, &$eventData, $addData = null)
200203
break;
201204

202205
case 'frontend_comment':
203-
if (serendipity_db_bool($this->get_config('COMMENT', 'true'))) {
204-
$url = $this->get_config('textile_version') == 1
205-
? 'http://www.textism.com/tools/textile/'
206-
: 'http://txstyle.org/article/43/a-short-introduction';
207-
echo '<div class="serendipity_commentDirection serendipity_comment_textile">' . sprintf(PLUGIN_EVENT_TEXTILE_TRANSFORM, $url) . '</div>';
206+
if (serendipity_db_bool($this->get_config('COMMENT', 'true'))) {;
207+
echo '<div class="serendipity_commentDirection serendipity_comment_textile">' . sprintf(PLUGIN_EVENT_TEXTILE_TRANSFORM, 'https://textile-lang.com/') . '</div>';
208208
}
209209
break;
210210

0 commit comments

Comments
 (0)