BUG 13974 "Error in triggers in lines of code commented" SOLVED

- Error in triggers in lines of code commented.
- Problema Resuelto, Se valida el Script del triggers quitando todo los comnetarios que existe en el codigo antes de ser
  ejecutado, el cambio se lo realizo en el metodo "setScript($sScript = '')".
This commit is contained in:
Luis Fernando Saisa Lopez
2014-03-14 14:10:22 -04:00
parent bfe3085b7d
commit 75f0697093

View File

@@ -151,6 +151,39 @@ class PMScript
*/
public function setScript ($sScript = '')
{
$nrt = array("\n", "\r", "\t");
$nrthtml = array("(n /)", "(r /)", "(t /)");
$script = $sScript;
$script = str_replace($nrt, $nrthtml, $script);
while (preg_match("/^(.*)\/\*(.*)$/", $script, $arrayMatch)) {
$scriptAux = "";
if (preg_match("/^.*\*\/.*$/", $arrayMatch[2])) {
$arrayAux = explode("*/", $arrayMatch[2]);
unset($arrayAux[0]);
$scriptAux = implode("*/", $arrayAux);
}
$script = $arrayMatch[1] . $scriptAux;
}
while (preg_match("/^(.*)(?:\/\/|#)(.*)$/", $script, $arrayMatch)) {
$scriptAux = "";
if (preg_match("/^.*\(n\s\/\).*$/", $arrayMatch[2])) {
$arrayAux = explode("(n /)", $arrayMatch[2]);
unset($arrayAux[0]);
$scriptAux = implode("(n /)", $arrayAux);
}
$script = $arrayMatch[1] . $scriptAux;
}
$script = str_replace($nrthtml, $nrt, $script);
$sScript = $script;
$this->sScript = $sScript;
}