Revision: 2314
          http://mrbs.svn.sourceforge.net/mrbs/?rev=2314&view=rev
Author:   cimorrison
Date:     2012-07-05 09:12:26 +0000 (Thu, 05 Jul 2012)
Log Message:
-----------
Fixed bug causing the wrong results to be returned if you happen to search for 
the text that is associated with the '' option in a mandatory custom field that 
uses a select box.

Modified Paths:
--------------
    mrbs/trunk/web/report.php
    mrbs/trunk/web/search.php

Modified: mrbs/trunk/web/report.php
===================================================================
--- mrbs/trunk/web/report.php   2012-07-02 11:12:56 UTC (rev 2313)
+++ mrbs/trunk/web/report.php   2012-07-05 09:12:26 UTC (rev 2314)
@@ -980,7 +980,8 @@
       {
         // We have to use strpos() rather than stripos() because we cannot
         // assume PHP5
-        if (strpos(strtolower($option_value), strtolower($$var)) !== FALSE)
+        if (($option_key != '') &&
+            (strpos(strtolower($option_value), strtolower($$var)) !== FALSE))
         {
           $or_array[] = "E.$key='" . sql_escape($option_key) . "'";
         }

Modified: mrbs/trunk/web/search.php
===================================================================
--- mrbs/trunk/web/search.php   2012-07-02 11:12:56 UTC (rev 2313)
+++ mrbs/trunk/web/search.php   2012-07-05 09:12:26 UTC (rev 2314)
@@ -214,7 +214,7 @@
       {
         // We have to use strpos() rather than stripos() because we cannot
         // assume PHP5
-        if (strpos(strtolower($value), strtolower($search_str)) !== FALSE)
+        if (($key != '') && (strpos(strtolower($value), 
strtolower($search_str)) !== FALSE))
         {
           $sql_pred .= " OR E." . $field['name'] . "='" . sql_escape($key) . 
"'";
         }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to