[-] BO: Fix #PSCFV-6383 allow numerics chars on SQL Manager

This commit is contained in:
Rémi Gaillard
2013-01-21 16:32:31 +01:00
parent ad9543fc53
commit 1915ea63a7
+2 -2
View File
@@ -247,7 +247,7 @@ class RequestSqlCore extends ObjectModel
*/ */
public function cutAttribute($attr, $from) public function cutAttribute($attr, $from)
{ {
if (preg_match('#^((`(\()?([a-z_])+`(\))?)|((\()?([a-z_])+(\))?))\.((`(\()?([a-z_])+`(\))?)|((\()?([a-z_])+(\))?))$#i', $attr)) if (preg_match('#^((`(\()?([a-z0-9_])+`(\))?)|((\()?([a-z0-9_])+(\))?))\.((`(\()?([a-z0-9_])+`(\))?)|((\()?([a-z0-9_])+(\))?))$#i', $attr))
{ {
$tab = explode('.', str_replace(array('`', '(', ')'), '', $attr)); $tab = explode('.', str_replace(array('`', '(', ')'), '', $attr));
if (!$table = $this->returnNameTable($tab[0], $from)) if (!$table = $this->returnNameTable($tab[0], $from))
@@ -258,7 +258,7 @@ class RequestSqlCore extends ObjectModel
'attribut' => $tab[1], 'attribut' => $tab[1],
'string' => $attr); 'string' => $attr);
} }
else if (preg_match('#^((`(\()?([a-z_])+`(\))?)|((\()?([a-z_])+(\))?))$#i', $attr)) elseif (preg_match('#^((`(\()?([a-z0-9_])+`(\))?)|((\()?([a-z0-9_])+(\))?))$#i', $attr))
{ {
$attribut = str_replace(array('`', '(', ')'), '', $attr); $attribut = str_replace(array('`', '(', ')'), '', $attr);
if (!$table = $this->returnNameTable(false, $from)) if (!$table = $this->returnNameTable(false, $from))