disable warnings under PHP 8 for now, as the hide fatal errors and log errors in xet files

This commit is contained in:
Ralf Becker 2021-03-31 11:30:34 +02:00
parent 6ce05919b6
commit 79040d1524
2 changed files with 9 additions and 7 deletions

View File

@ -650,7 +650,7 @@ class Widget
* This is mainly used for autorepeat, but other use is possible.
* You need to be aware of the rules PHP uses to expand vars in strings, a name
* of "Row$row[length]" will expand to 'Row' as $row is scalar, you need to use
* "Row${row}[length]" instead. Only one indirection is allowd in a string by php !!!
* "Row${row}[length]" instead. Only one indirection is allowed in a string by php !!!
* Out of that reason we have now the variable $row_cont, which is $cont[$row] too.
* Attention !!!
* Using only number as index in field-names causes a lot trouble, as depending
@ -686,8 +686,13 @@ class Widget
$row_cont = $cont[$row];
$col_row_cont = $cont[$col.$row];
eval('$name = "'.str_replace('"','\\"',$name).'";');
unset($col_, $row_, $row_cont, $col_row_cont); // quiten IDE warning about used vars, they might be used in above eval!
try {
eval('$name = "' . str_replace('"', '\\"', $name) . '";');
}
catch(\Throwable $e) {
_egw_log_exception($e);
}
unset($col_, $row_, $row_cont, $col_row_cont); // quieten IDE warning about used vars, they might be used in above eval!
}
if ($is_index_in_content)
{

View File

@ -179,10 +179,7 @@ function egw_error_handler ($errno, $errstr, $errfile, $errline)
case E_USER_WARNING:
// skip message for warnings supressed via @-error-control-operator (eg. @is_dir($path))
// can be commented out to get suppressed warnings too!
if ((error_reporting() & $errno) &&
// silence "Declaration of $class::$method should be compatible with $parent::$method" warning
!(substr($errstr, 0, 15) === 'Declaration of ' &&
strpos($errstr, ' should be compatible with ') !== false))
if ((error_reporting() & $errno) && PHP_VERSION < 8.0)
{
_egw_log_exception(new egw_exception_warning($errstr.' in '.$errfile.' on line '.$errline));
}