Hello,<br>My name is Stanislav Palatnik. I&#39;ve applied for gsoc 2009. I&#39;ve looked over some bugs and have a proposal to solve bug 0000853<br>Basically it doesn&#39;t check if the date was valid. <div><br>Current line: search.class.php</div>
<div><br>if (!empty($this-&gt;_dateStart) AND !empty($this-&gt;_dateEnd)) {</div><div><br></div><div><br>It works fine if the date format is valid. Even if you enter 1921-33-44 to 2034-22-33 it will still return the results. However, if the format is different IE 192-133-44 then you(well me at least) will get a rather pointless error message &quot;Unfortunately, an error has occurred rendering this page. Please try again later.&quot;<br>
The simplest fix is including checkdate() in both the start and end dates</div><div><br>fixed line:</div><div><br>         if (!empty($this-&gt;_dateStart) &amp;&amp; !empty($this-&gt;_dateEnd) &amp;&amp; checkdate($DE[1],$DE[2],$DE[0]) &amp;&amp; checkdate($DS[1],$DS[2],$DS[0])) {</div>
<div><br></div><div>Another faster solution would be just to check if mkdate returns false</div><div><br></div><div><div>                    $startdate = mktime(0,0,0,$DS[1],$DS[2],$DS[0]);</div><div>                    $enddate = mktime(23,59,59,$DE[1],$DE[2],$DE[0]);</div>
<div>                    if($startdate!=false &amp;&amp; $enddate!=false)  $sql .= &quot;AND (UNIX_TIMESTAMP({$_TABLES[&#39;comments&#39;]}.date) BETWEEN &#39;$startdate&#39; AND &#39;$enddate&#39;) &quot;;</div><div><br>
</div><div>For even faster peformance, explicity put !=false to make PHP use less guessing</div><br>--<br>Warmly,<br><br>Stanislav<br><br><br></div>