Re: com web/doc-editor: Fix Year ; add others auth service: scripts/utils/static_stats.php
| From: | Kalle Sommer Nielsen | Date: | Thu, 07 Aug 2014 00:10:29 +0000 |
| Subject: | Re: com web/doc-editor: Fix Year ; add others auth service: scripts/utils/static_stats.php | ||
| References: | 1 | Groups: | php.doc.cvs |
| Request: | Send a blank email to doc-cvs+get-12709@lists.php.net to get a copy of this message | ||
Hi Yannick
2014-08-06 23:22 GMT+02:00 Yannick Torres <yannick@php.net>:
> $year = ( isset($_GET['d']) ) ? $_GET['d'] :
> $nowDate->format('Y');
Shouldn't this be:
$year = (isset($_GET['d']) ? (integer) $_GET['d'] :
$nowDate->format('Y'));
Instead to prevent sql injection, or does the DAL prevent that?
(Didn't look deeply, just curious)
>
> $db = DBConnection::getInstance();
>
> -
> -
> $s = "select * from staticValue WHERE type='info' and
> YEAR(
date)='".$year."'";
> $r = $db->query($s, array());
--
regards,
Kalle Sommer Nielsen
kalle@php.net