dregad - 2014-02-24

Can you test this code ?

diff --git a/adodb-active-record.inc.php b/adodb-active-record.inc.php
index 38a53e1..261e941 100644
--- a/adodb-active-record.inc.php
+++ b/adodb-active-record.inc.php
@@ -641,13 +641,13 @@ class ADODB_Active_Record {
                case 'N':
                case 'C':
                case 'X':
-                       if (is_null($val)) return 'null';
-
-                       if (strlen($val)>0 &&
-                               (strncmp($val,"'",1) != 0 || substr($val,strlen($val)-1,1) != "'")) {
+                       if (!is_null($val) &&
+                           strlen($val) > 0 &&
+                           (strncmp($val, "'", 1) != 0 || substr($val, -1) != "'")
+                       ) {
                                return $db->qstr($val);
-                               break;
                        }
+                       return 'null';
                default:
                        return $val;
                        break;