summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--adodb-active-record.inc.php4
-rw-r--r--adodb-active-recordx.inc.php4
2 files changed, 2 insertions, 6 deletions
diff --git a/adodb-active-record.inc.php b/adodb-active-record.inc.php
index 001d46d9..e3eb52c0 100644
--- a/adodb-active-record.inc.php
+++ b/adodb-active-record.inc.php
@@ -742,9 +742,7 @@ class ADODB_Active_Record {
if ('' === (string)$val) {
return "''";
}
- if (strlen($val) > 0 &&
- (strncmp($val, "'", 1) != 0 || substr($val, strlen($val) - 1, 1) != "'")
- ) {
+ if (substr($val, 0, 1) != "'" || substr($val,-1) != "'") {
return $db->qstr($val);
}
default:
diff --git a/adodb-active-recordx.inc.php b/adodb-active-recordx.inc.php
index 079352f1..503d34dd 100644
--- a/adodb-active-recordx.inc.php
+++ b/adodb-active-recordx.inc.php
@@ -780,9 +780,7 @@ class ADODB_Active_Record {
if ('' === (string)$val) {
return "''";
}
- if (strlen($val) > 0 &&
- (strncmp($val, "'", 1) != 0 || substr($val, strlen($val) - 1, 1) != "'")
- ) {
+ if (substr($val, 0, 1) != "'" || substr($val,-1) != "'") {
return $db->qstr($val);
}
default: