Revision: 2558
          https://sourceforge.net/p/mrbs/code/2558/
Author:   cimorrison
Date:     2012-11-05 16:51:11 +0000 (Mon, 05 Nov 2012)
Log Message:
-----------
Fixed occurrences of != '' being used instead of !== ''.   Causes bugs such as 
Confirmed as well as Tentative reports being shown in reports when only 
tentative have been requested.

Modified Paths:
--------------
    mrbs/trunk/web/functions.inc
    mrbs/trunk/web/functions_mail.inc
    mrbs/trunk/web/language.inc
    mrbs/trunk/web/report.php
    mrbs/trunk/web/search.php
    mrbs/trunk/web/session/session_cookie.inc
    mrbs/trunk/web/session/session_http.inc
    mrbs/trunk/web/session/session_php.inc

Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc        2012-11-05 15:19:14 UTC (rev 2557)
+++ mrbs/trunk/web/functions.inc        2012-11-05 16:51:11 UTC (rev 2558)
@@ -674,7 +674,7 @@
   $html .= (isset($params['maxlength'])) ? " maxlength=\"" . 
$params['maxlength'] . "\"" : '';
   // Don't give an empty string if it's a number as that's not a valid 
floating point number
   // and will fail HTML5 validation
-  if (($params['value'] != '') ||
+  if (($params['value'] !== '') ||
       (isset($params['type']) && ($params['type'] != 'number')) )
   {
     $html .= " value=\"" . htmlspecialchars($params['value']) . "\"";
@@ -1022,7 +1022,7 @@
       else
       {
         $first_child = each($params['options']);
-        if (($first_child['key'] != '') && ($first_child['value'] != ''))
+        if (($first_child['key'] !== '') && ($first_child['value'] !== ''))
         {
           $message = "The first child option element of a select element with 
a required " .
                      "attribute and without a multiple attribute, and whose 
size is 1, " .

Modified: mrbs/trunk/web/functions_mail.inc
===================================================================
--- mrbs/trunk/web/functions_mail.inc   2012-11-05 15:19:14 UTC (rev 2557)
+++ mrbs/trunk/web/functions_mail.inc   2012-11-05 16:51:11 UTC (rev 2558)
@@ -177,7 +177,7 @@
   for ($i=0; $i < count($array); $i++)
   {
     $array[$i] = trim($array[$i]);
-    if ($array[$i] != '')
+    if ($array[$i] !== '')
     {
       $trimmed_array[] = $array[$i];
     }
@@ -504,7 +504,7 @@
     $body .= ($as_html) ? "</p><p>" : "\n\n";
     $body .= ($as_html) ? "<a target=\"_blank\" href=\"" : "";
     // Set the link to view entry page
-    if (isset($url_base) && ($url_base != ""))
+    if (isset($url_base) && ($url_base !== ''))
     {
       $body .= "$url_base/view_entry.php?id=" . $data['id'];
     }

Modified: mrbs/trunk/web/language.inc
===================================================================
--- mrbs/trunk/web/language.inc 2012-11-05 15:19:14 UTC (rev 2557)
+++ mrbs/trunk/web/language.inc 2012-11-05 16:51:11 UTC (rev 2558)
@@ -561,7 +561,7 @@
   
   $mrbs_locale = FALSE;
   
-  if ($override_locale != "")
+  if ($override_locale !== '')
   {
     $mrbs_locale = $override_locale;
     $windows_locale = $mrbs_locale;

Modified: mrbs/trunk/web/report.php
===================================================================
--- mrbs/trunk/web/report.php   2012-11-05 15:19:14 UTC (rev 2557)
+++ mrbs/trunk/web/report.php   2012-11-05 16:51:11 UTC (rev 2558)
@@ -733,7 +733,7 @@
             if (isset($select_options["entry.$field"]) &&
                 is_assoc($select_options["entry.$field"]) && 
                 array_key_exists($value, $select_options["entry.$field"]) &&
-                ($value != ''))
+                ($value !== ''))
             {
               $value = $select_options["entry.$field"][$value];
             }
@@ -1267,21 +1267,22 @@
   // an error in PostgreSQL as the expression is of the wrong type.
   
   // Match the privacy status
-  if (($match_private != PRIVATE_BOTH) && ($match_private != ''))
+  if (($match_private != PRIVATE_BOTH) && ($match_private !== ''))
   {
     $sql .= " AND ";
     $sql .= "(E.status&" . STATUS_PRIVATE;
     $sql .= ($match_private) ? "!=0)" : "=0)";  // Note that private works the 
other way round to the next two
   }
+
   // Match the confirmation status
-  if (($match_confirmed != CONFIRMED_BOTH) && ($match_confirmed != ''))
+  if (($match_confirmed != CONFIRMED_BOTH) && ($match_confirmed !== ''))
   {
     $sql .= " AND ";
     $sql .= "(E.status&" . STATUS_TENTATIVE;
     $sql .= ($match_confirmed) ? "=0)" : "!=0)";
   }
   // Match the approval status
-  if (($match_approved != APPROVED_BOTH) && ($match_approved != ''))
+  if (($match_approved != APPROVED_BOTH) && ($match_approved !== ''))
   {
     $sql .= " AND ";
     $sql .= "(E.status&" . STATUS_AWAITING_APPROVAL;
@@ -1305,7 +1306,7 @@
       {
         // We have to use strpos() rather than stripos() because we cannot
         // assume PHP5
-        if (($option_key != '') &&
+        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-11-05 15:19:14 UTC (rev 2557)
+++ mrbs/trunk/web/search.php   2012-11-05 16:51:11 UTC (rev 2558)
@@ -214,7 +214,7 @@
       {
         // We have to use strpos() rather than stripos() because we cannot
         // assume PHP5
-        if (($key != '') && (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) . 
"'";
         }

Modified: mrbs/trunk/web/session/session_cookie.inc
===================================================================
--- mrbs/trunk/web/session/session_cookie.inc   2012-11-05 15:19:14 UTC (rev 
2557)
+++ mrbs/trunk/web/session/session_cookie.inc   2012-11-05 16:51:11 UTC (rev 
2558)
@@ -263,7 +263,7 @@
   global $PHP_SELF, $QUERY_STRING, $user_list_link, $day, $month, $year;
   
   $TargetURL = basename($PHP_SELF);
-  if (isset($url_base) && ($url_base != ""))
+  if (isset($url_base) && ($url_base !== ''))
   {
     $TargetURL = $url_base . '/' . $TargetURL;
   }

Modified: mrbs/trunk/web/session/session_http.inc
===================================================================
--- mrbs/trunk/web/session/session_http.inc     2012-11-05 15:19:14 UTC (rev 
2557)
+++ mrbs/trunk/web/session/session_http.inc     2012-11-05 16:51:11 UTC (rev 
2558)
@@ -80,7 +80,7 @@
   global $PHP_SELF, $QUERY_STRING, $user_list_link, $day, $month, $year;
   
   $TargetURL = basename($PHP_SELF);
-  if (isset($url_base) && ($url_base != ""))
+  if (isset($url_base) && ($url_base !== ''))
   {
     $TargetURL = $url_base . '/' . $TargetURL;
   }

Modified: mrbs/trunk/web/session/session_php.inc
===================================================================
--- mrbs/trunk/web/session/session_php.inc      2012-11-05 15:19:14 UTC (rev 
2557)
+++ mrbs/trunk/web/session/session_php.inc      2012-11-05 16:51:11 UTC (rev 
2558)
@@ -201,14 +201,14 @@
 
 function getUserName()
 {
-  if (isset($_SESSION) && isset($_SESSION["UserName"]) && 
($_SESSION["UserName"] != ""))
+  if (isset($_SESSION) && isset($_SESSION["UserName"]) && 
($_SESSION["UserName"] !== ''))
   {
     return $_SESSION["UserName"];
   }
   else
   {
     global $HTTP_SESSION_VARS;
-    if (isset($HTTP_SESSION_VARS["UserName"]) && 
($HTTP_SESSION_VARS["UserName"] != ""))
+    if (isset($HTTP_SESSION_VARS["UserName"]) && 
($HTTP_SESSION_VARS["UserName"] !== ''))
     {
       return $HTTP_SESSION_VARS["UserName"];
     }
@@ -221,7 +221,7 @@
   global $PHP_SELF, $QUERY_STRING, $user_list_link, $day, $month, $year;
 
   $TargetURL = basename($PHP_SELF);
-  if (isset($url_base) && ($url_base != ""))
+  if (isset($url_base) && ($url_base !== ''))
   {
     $TargetURL = $url_base . '/' . $TargetURL;
   }
------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to