mirror of
https://github.com/friendica/friendica
synced 2025-04-25 07:50:10 +00:00
Review update
Rename function, move others
This commit is contained in:
parent
0f1be37279
commit
f04d40a37e
55 changed files with 331 additions and 326 deletions
|
@ -413,4 +413,20 @@ class XML
|
|||
$child->parentNode->removeChild($child);
|
||||
}
|
||||
}
|
||||
|
||||
public static function parseString($s, $strict = true)
|
||||
{
|
||||
// the "strict" parameter is deactivated
|
||||
libxml_use_internal_errors(true);
|
||||
|
||||
$x = @simplexml_load_string($s);
|
||||
if (!$x) {
|
||||
logger('libxml: parse: error: ' . $s, LOGGER_DATA);
|
||||
foreach (libxml_get_errors() as $err) {
|
||||
logger('libxml: parse: ' . $err->code." at ".$err->line.":".$err->column." : ".$err->message, LOGGER_DATA);
|
||||
}
|
||||
libxml_clear_errors();
|
||||
}
|
||||
return $x;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue