Modification regex pour la prise en compte des variables *_MT

This commit is contained in:
Michael RICOIS 2012-05-22 07:24:23 +00:00
parent 5836dae13f
commit c0496ca000

View File

@ -400,10 +400,19 @@ function genereCacheIndiscore($version, $type = 'scores')
$valeur.=')/'.$matches[2].')';
}
else
{
$valeur=preg_replace('/([A-Z\_]{1,30})\((.*)\)$/i','substr(\$$1,$2)', $valeur);
}
if (substr($valeur,0,6)<>'substr' && substr($valeur,0,1)<>"'")
$valeur=preg_replace('/([A-Z\_]{1,30})/','\$$1', $valeur);
if ( !empty($valeur)
|| substr($valeur,0,6)!='substr' && substr($valeur,0,1)!="'"
|| !in_array($valeur, array('vrai', 'faux'))
) {
//file_put_contents('test.log', $valeur, FILE_APPEND);
$valeur = preg_replace('/([A-Z][A-Z0-9\_]{1,29}|[A-Za-z0-9]{1,30}\[[0-9]+\])/' , '\$$1' , $valeur);
//file_put_contents('test.log', " = ".$valeur."\n", FILE_APPEND);
}
if (preg_match("/^substr|^projec|^strlen|^\||^'/i", $ope1)) {
$ope1deb='';