summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-09-16 08:06:09 +0000
committeralecpl <alec@alec.pl>2011-09-16 08:06:09 +0000
commit8c124b9ea8ae5a1793c61ccb4c4e5c0dd0f77787 (patch)
tree72230a887c89be2c68a386e72b017441c66c0e96
parent699a25a822276c12a0aa9253dd6a397c1b09899b (diff)
- Fix is_a() usage
-rw-r--r--program/lib/MDB2/Driver/Datatype/Common.php6
-rw-r--r--program/lib/PEAR.php2
-rw-r--r--program/steps/mail/func.inc2
3 files changed, 5 insertions, 5 deletions
diff --git a/program/lib/MDB2/Driver/Datatype/Common.php b/program/lib/MDB2/Driver/Datatype/Common.php
index 2a815cbef..2083d7577 100644
--- a/program/lib/MDB2/Driver/Datatype/Common.php
+++ b/program/lib/MDB2/Driver/Datatype/Common.php
@@ -1379,7 +1379,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
if (PEAR::isError($db)) {
return $db;
}
- if (isset($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
+ if (isset($db->function) && is_object($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
return $db->function->now('date');
}
return 'CURRENT_DATE';
@@ -1408,7 +1408,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
if (PEAR::isError($db)) {
return $db;
}
- if (isset($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
+ if (isset($db->function) && is_object($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
return $db->function->now('timestamp');
}
return 'CURRENT_TIMESTAMP';
@@ -1437,7 +1437,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
if (PEAR::isError($db)) {
return $db;
}
- if (isset($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
+ if (isset($db->function) && is_object($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
return $db->function->now('time');
}
return 'CURRENT_TIME';
diff --git a/program/lib/PEAR.php b/program/lib/PEAR.php
index a792d9f57..8cc715204 100644
--- a/program/lib/PEAR.php
+++ b/program/lib/PEAR.php
@@ -265,7 +265,7 @@ class PEAR
*/
function isError($data, $code = null)
{
- if (!is_a($data, 'PEAR_Error')) {
+ if (!is_object($data) || !is_a($data, 'PEAR_Error')) {
return false;
}
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index ab4b2907a..98040e99f 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1451,7 +1451,7 @@ function rcmail_send_mdn($message, &$smtp_error)
{
global $RCMAIL, $IMAP;
- if (!is_object($message) || !is_a($message, rcube_message))
+ if (!is_object($message) || !is_a($message, 'rcube_message'))
$message = new rcube_message($message);
if ($message->headers->mdn_to && !$message->headers->mdnsent &&