Author: danydb
Date: 2012-01-09 14:36:31 +0100 (Mon, 09 Jan 2012)
New Revision: 4694
Modified:
phpcompta/trunk/include/class_fiche_attr.php
Log:
SQL Protect
Modified: phpcompta/trunk/include/class_fiche_attr.php
===================================================================
--- phpcompta/trunk/include/class_fiche_attr.php 2012-01-09 13:12:40 UTC
(rev 4693)
+++ phpcompta/trunk/include/class_fiche_attr.php 2012-01-09 13:36:31 UTC
(rev 4694)
@@ -87,9 +87,11 @@
$this->ad_size=22;
}
}
- if ( $this->ad_extra == 'select')
+ echo $this->ad_type;
+ if ( $this->ad_type == 'select')
{
if (trim($this->ad_extra)=="") throw new Exception ("La
requête SQL est vide ");
+ if ( preg_match('/^\h*select/i',$this->ad_extra) == 0) throw
new Exception ("La requête SQL doit commencer par SELECT ");
try{
$this->cn->exec_sql($this->ad_extra);
@@ -156,7 +158,7 @@
);
} catch (Exception $e)
{
- throw ($e);
+ throw $e;
}
}
@@ -179,7 +181,7 @@
);
}catch (Exception $e)
{
- throw ($e);
+ throw $e;
}
_______________________________________________
Phpcompta-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/phpcompta-dev