1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-22 22:51:11 +01:00

Further improvement

This commit is contained in:
Daniil Gentili 2021-12-15 14:15:10 +01:00
parent 6e3fe54954
commit 5969ebe783
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -83,15 +83,15 @@ class Exception extends \Exception
*/
public static function exceptionErrorHandler($errno = 0, $errstr = null, $errfile = null, $errline = null): bool
{
$errfile = \str_replace('phabel.transpiler'.PHP_MAJOR_VERSION.PHP_MINOR_VERSION, '', $errfile ?? '');
$errfileReplaced = \str_replace('phabel.transpiler'.PHP_MAJOR_VERSION.PHP_MINOR_VERSION.':', '', $errfile ?? '');
// If error is suppressed with @, don't throw an exception
if (\error_reporting() === 0
|| \strpos($errstr, 'headers already sent')
|| \strpos($errstr, 'Creation of dynamic property') !== false
|| $errfile && (
\strpos($errfile, DIRECTORY_SEPARATOR.'amphp'.DIRECTORY_SEPARATOR) !== false
|| \strpos($errfile, DIRECTORY_SEPARATOR.'league'.DIRECTORY_SEPARATOR) !== false
|| \strpos($errfile, DIRECTORY_SEPARATOR.'phpseclib'.DIRECTORY_SEPARATOR) !== false
|| $errfileReplaced && (
\strpos($errfileReplaced, DIRECTORY_SEPARATOR.'amphp'.DIRECTORY_SEPARATOR) !== false
|| \strpos($errfileReplaced, DIRECTORY_SEPARATOR.'league'.DIRECTORY_SEPARATOR) !== false
|| \strpos($errfileReplaced, DIRECTORY_SEPARATOR.'phpseclib'.DIRECTORY_SEPARATOR) !== false
)
) {
return false;