Disable XML loading plugins on old PHP

When libxml_disable_entity_loader is not available, we can not guarantee
safe handling of XML data.
This commit is contained in:
Michal Čihař
2011-11-07 15:18:10 +01:00
parent a5e206fbd2
commit 34d99de000
2 changed files with 16 additions and 6 deletions

View File

@@ -13,6 +13,13 @@ if (! defined('PHPMYADMIN')) {
exit; exit;
} }
/**
* We need way to disable external XML entities processing.
*/
if (!function_exists('libxml_disable_entity_loader')) {
return;
}
/** /**
* The possible scopes for $plugin_param are: 'table', 'database', and 'server' * The possible scopes for $plugin_param are: 'table', 'database', and 'server'
*/ */
@@ -66,9 +73,7 @@ unset($data);
/** /**
* Disable loading of external XML entities. * Disable loading of external XML entities.
*/ */
if (function_exists('libxml_disable_entity_loader')) {
libxml_disable_entity_loader(); libxml_disable_entity_loader();
}
/** /**
* Load the XML string * Load the XML string

View File

@@ -12,6 +12,13 @@ if (! defined('PHPMYADMIN')) {
exit; exit;
} }
/**
* We need way to disable external XML entities processing.
*/
if (!function_exists('libxml_disable_entity_loader')) {
return;
}
/** /**
* The possible scopes for $plugin_param are: 'table', 'database', and 'server' * The possible scopes for $plugin_param are: 'table', 'database', and 'server'
*/ */
@@ -59,9 +66,7 @@ unset($data);
/** /**
* Disable loading of external XML entities. * Disable loading of external XML entities.
*/ */
if (function_exists('libxml_disable_entity_loader')) {
libxml_disable_entity_loader(); libxml_disable_entity_loader();
}
/** /**
* Load the XML string * Load the XML string