Skip to content

Commit 5efdbfa

Browse files
committed
[task/php54] Disable E_STRICT in Olympus when running on PHP 5.4.
We cannot use static in Olympus because it must be PHP 4 compatible. Therefore disable E_STRICT for Olympus. This commit should be reverted for Ascraeus. PHPBB3-10615
1 parent 71afba0 commit 5efdbfa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

phpBB/includes/startup.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@
2020
define('E_DEPRECATED', 8192);
2121
}
2222
$level = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
23+
if (version_compare(PHP_VERSION, '5.4.0-dev', '>='))
24+
{
25+
// PHP 5.4 adds E_STRICT to E_ALL.
26+
// Our utf8 normalizer triggers E_STRICT output on PHP 5.4.
27+
// Unfortunately it cannot be made E_STRICT-clean while
28+
// continuing to work on PHP 4.
29+
// Therefore, in phpBB 3.0.x we disable E_STRICT on PHP 5.4+,
30+
// while phpBB 3.1 will fix utf8 normalizer.
31+
// E_STRICT is defined starting with PHP 5
32+
if (!defined('E_STRICT'))
33+
{
34+
define('E_STRICT', 2048);
35+
}
36+
$level &= ~E_STRICT;
37+
}
2338
error_reporting($level);
2439

2540
/*

0 commit comments

Comments
 (0)