Skip to content

Commit 1a9c45d

Browse files
authored
Remove deprecated constant E_STRICT (#871)
Unused since PHP 8.0
1 parent a6619f7 commit 1a9c45d

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

docs/NEWS

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Version 2.6-alpha1 ()
22
------------------------------------------------------------------------
33

4+
* PHP 8.4 fix: Remove deprecated constant E_STRICT
5+
46
* PHP 8 compatibility fixes for bundled XML/RPC.php
57

68
* Upgrade bundled jQuery to jQuery 3

include/compat.inc.php

-3
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ function debug_ErrorLevelType($type)
9595
return 'E_USER_WARNING';
9696
case E_USER_NOTICE: // 1024 //
9797
return 'E_USER_NOTICE';
98-
case E_STRICT: // 2048 //
99-
return 'E_STRICT';
10098
case E_RECOVERABLE_ERROR: // 4096 //
10199
return 'E_RECOVERABLE_ERROR';
102100
case E_DEPRECATED: // 8192 //
@@ -139,7 +137,6 @@ function errorToExceptionHandler($errNo, $errStr, $errFile = '', $errLine = NULL
139137

140138
case E_USER_NOTICE:
141139
case E_NOTICE:
142-
case @E_STRICT:
143140
case @E_DEPRECATED:
144141
case @E_USER_DEPRECATED:
145142
$type = 'Notice';

include/serendipity_smarty_class.inc.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ private function setParams()
189189
}
190190

191191
// set smarty error reporting. General error_reporting is set in serendipity/serendipity_config.inc.php
192-
$this->error_reporting = E_ALL & ~(E_NOTICE|E_STRICT);
193-
// Avoid a multitude of warnings when using Smarty on a newer PHP version, liek when we jumped
192+
$this->error_reporting = E_ALL & ~(E_NOTICE);
193+
// Avoid a multitude of warnings when using Smarty on a newer PHP version, like when we jumped
194194
// to PHP 8:
195195
$this->muteUndefinedOrNullWarnings();
196196
}

serendipity_config.inc.php

+4-11
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@
6464

6565
// Set error reporting
6666
if ($serendipity['production']) {
67-
error_reporting(E_ALL & ~(E_WARNING|E_NOTICE|E_STRICT|E_DEPRECATED));
67+
error_reporting(E_ALL & ~(E_WARNING|E_NOTICE|E_DEPRECATED));
6868
@ini_set('display_errors', 'off');
6969
} else {
70-
error_reporting(E_ALL & ~(E_NOTICE|E_STRICT|E_DEPRECATED));
70+
error_reporting(E_ALL & ~(E_NOTICE|E_DEPRECATED));
7171
}
7272

7373
if ($serendipity['production'] !== true) {
@@ -303,21 +303,14 @@
303303
include($local_config);
304304

305305
if ($serendipity['production'] === 'debug') {
306-
error_reporting(E_ALL ^ E_NOTICE); // is 32759 with 5.4+
306+
error_reporting(E_ALL ^ E_NOTICE);
307307
}
308308
if ($serendipity['production'] === false) {
309-
error_reporting(E_ALL & ~(E_NOTICE|E_STRICT)); // is 30711 with 5.4+
309+
error_reporting(E_ALL & ~(E_NOTICE));
310310
}
311311

312312
$errLevel = error_reporting();
313313

314-
/* [DEBUG] Helper to display current error levels, meant for developers.
315-
echo $errLevel."<br>\n";
316-
for ($i = 0; $i < 15; $i++ ) {
317-
print debug_ErrorLevelType($errLevel & pow(2, $i)) . "<br>\n";
318-
}
319-
*/
320-
321314
// [internal callback function]: errorToExceptionHandler()
322315
if (is_callable($serendipity['errorhandler'], false, $callable_name)) {
323316
// set serendipity global error to exception handler

0 commit comments

Comments
 (0)