Skip to content

Commit 4922460

Browse files
committed
Remove libxml_get_last_error because false is not an error in this case, fixes #438
1 parent bd4b5e7 commit 4922460

File tree

4 files changed

+1
-21
lines changed

4 files changed

+1
-21
lines changed

generated/functionsList.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,6 @@
468468
'ldap_sasl_bind',
469469
'ldap_set_option',
470470
'ldap_unbind',
471-
'libxml_get_last_error',
472471
'libxml_set_external_entity_loader',
473472
'link',
474473
'lstat',

generated/libxml.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,6 @@
44

55
use Safe\Exceptions\LibxmlException;
66

7-
/**
8-
* Retrieve last error from libxml.
9-
*
10-
* @return \LibXMLError Returns a LibXMLError object if there is any error in the
11-
* buffer.
12-
* @throws LibxmlException
13-
*
14-
*/
15-
function libxml_get_last_error(): \LibXMLError
16-
{
17-
error_clear_last();
18-
$safeResult = \libxml_get_last_error();
19-
if ($safeResult === false) {
20-
throw LibxmlException::createFromPhpError();
21-
}
22-
return $safeResult;
23-
}
24-
25-
267
/**
278
* Changes the default external entity loader.
289
* This can be used to suppress the expansion of arbitrary external entities to avoid XXE attacks,

generator/config/ignoredFunctions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
'apcu_delete', // apcu_delete returns false when the $key does not exist in the cache store
1717
'filter_has_var', // this function is meant to return a boolean
1818
'array_multisort', // this function is too buggy, see PR #113 on GitHub
19+
'libxml_get_last_error', // returns false to mean "everything is fine"
1920
];

rector-migrate.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,6 @@
475475
'ldap_sasl_bind' => 'Safe\ldap_sasl_bind',
476476
'ldap_set_option' => 'Safe\ldap_set_option',
477477
'ldap_unbind' => 'Safe\ldap_unbind',
478-
'libxml_get_last_error' => 'Safe\libxml_get_last_error',
479478
'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader',
480479
'link' => 'Safe\link',
481480
'lstat' => 'Safe\lstat',

0 commit comments

Comments
 (0)