Prevent application duplicates and update the applications array. (#6173)
* Prevent application duplicates and filter the applications before the content. * Don't allow the new spawn commands as they are as dangerous as system commands. * Update dialplan_valid false to include bg_spawn, spawn and spawn_stream.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2019
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2021
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -81,12 +81,30 @@
|
||||
if (preg_match("/.*([\"\'])bgsystem([\"\']).*>/i", $dialplan_xml)) {
|
||||
$dialplan_valid = false;
|
||||
}
|
||||
if (preg_match("/.*([\"\'])bg_spawn([\"\']).*>/i", $dialplan_xml)) {
|
||||
$dialplan_valid = false;
|
||||
}
|
||||
if (preg_match("/.*([\"\'])spawn([\"\']).*>/i", $dialplan_xml)) {
|
||||
$dialplan_valid = false;
|
||||
}
|
||||
if (preg_match("/.*([\"\'])spawn_stream([\"\']).*>/i", $dialplan_xml)) {
|
||||
$dialplan_valid = false;
|
||||
}
|
||||
if (preg_match("/.*{system.*/i", $dialplan_xml)) {
|
||||
$dialplan_valid = false;
|
||||
}
|
||||
if (preg_match("/.*{bgsystem.*/i", $dialplan_xml)) {
|
||||
$dialplan_valid = false;
|
||||
}
|
||||
if (preg_match("/.*{bg_spawn.*/i", $dialplan_xml)) {
|
||||
$dialplan_valid = false;
|
||||
}
|
||||
if (preg_match("/.*{spawn.*/i", $dialplan_xml)) {
|
||||
$dialplan_valid = false;
|
||||
}
|
||||
if (preg_match("/.*{spawn_stream.*/i", $dialplan_xml)) {
|
||||
$dialplan_valid = false;
|
||||
}
|
||||
|
||||
//disable xml entities and load the xml object to test if the xml is valid
|
||||
libxml_disable_entity_loader(true);
|
||||
|
||||
Reference in New Issue
Block a user