2012-06-04 Sergio Martin <sergio.martin@artica.es>
* include/functions_modules.php include/functions_io.php: Added new safe string function to scape strings to use it in regular expressions and change the parameters of enterprise functions to be compatible con last changes Merged from 4.0.x git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6409 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
8bd6880a60
commit
374a1c30d4
|
@ -1,3 +1,12 @@
|
|||
2012-06-04 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_modules.php
|
||||
include/functions_io.php: Added new safe string function
|
||||
to scape strings to use it in regular expressions and
|
||||
change the parameters of enterprise functions to be
|
||||
compatible con last changes
|
||||
Merged from 4.0.x
|
||||
|
||||
2012-06-04 Vanessa Gil <vanessa.gil@artica.es>
|
||||
|
||||
* godmode/setup/os.list.php: Fixed bug: you can delete
|
||||
|
|
|
@ -30,6 +30,33 @@ function io_safe_input_array(&$item) {
|
|||
$item = io_safe_input($item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scape in a string de reserved characters to use it
|
||||
* into a regular expression
|
||||
*
|
||||
* @param string String to be scaped
|
||||
*
|
||||
* @return string Scaped string
|
||||
*/
|
||||
function io_safe_expreg($string) {
|
||||
// Scape regular expression characters
|
||||
$string = str_replace('(','\(',$string);
|
||||
$string = str_replace(')','\)',$string);
|
||||
$string = str_replace('{','\{',$string);
|
||||
$string = str_replace('}','\}',$string);
|
||||
$string = str_replace('[','\[',$string);
|
||||
$string = str_replace(']','\]',$string);
|
||||
$string = str_replace('.','\.',$string);
|
||||
$string = str_replace('*','\*',$string);
|
||||
$string = str_replace('+','\+',$string);
|
||||
$string = str_replace('?','\?',$string);
|
||||
$string = str_replace('|','\|',$string);
|
||||
$string = str_replace('^','\^',$string);
|
||||
$string = str_replace('$','\$',$string);
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans a string by encoding to UTF-8 and replacing the HTML
|
||||
* entities. UTF-8 is necessary for foreign chars like asian
|
||||
|
|
|
@ -172,7 +172,7 @@ function modules_copy_agent_module_to_agent ($id_agent_module, $id_destiny_agent
|
|||
|
||||
if ($remote_conf) {
|
||||
$result = enterprise_hook('config_agents_copy_agent_module_to_agent',
|
||||
array($id_agente, $id_agent_module, $id_new_module));
|
||||
array($id_agent_module, $id_new_module));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue