Add a is_xml function

This commit is contained in:
FusionPBX 2023-06-16 11:13:20 -06:00 committed by GitHub
parent 142b6dd323
commit 4d54821119
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -159,6 +159,13 @@
}
}
if (!function_exists('is_xml')) {
function is_xml($string) {
$pattern = '/^<\?xml(?:\s+[^>]+\s*)?\?>\s*<(\w+)>.*<\/\1>\s*$/s';
return preg_match($pattern, $string) === 1;
}
}
if (!function_exists('recursive_copy')) {
if (file_exists('/bin/cp')) {
function recursive_copy($source, $destination, $options = '') {