Hide differences in PHP 7.2 error reporting

It adds (this will throw an Error in a future version of PHP)
to undefined constant error.

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2017-07-31 16:47:20 +02:00
parent 456ec18cb1
commit fc2ac9f4c6

View File

@ -441,8 +441,13 @@ class Advisor
// Error handling
if ($err) {
// Remove PHP 7.2 and newer notice (it's not really interesting for user)
throw new Exception(
strip_tags($err)
str_replace(
' (this will throw an Error in a future version of PHP)',
'',
strip_tags($err)
)
. '<br />Executed code: $value = ' . htmlspecialchars($expr) . ';'
);
}