summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-05-06 12:07:05 +0200
committerAleksander Machniak <alec@alec.pl>2013-05-06 12:07:05 +0200
commitc027ba7709a86c23038428de15ffed503e67c522 (patch)
treea452d21c0a296edb2d8febd7c7712f40ea3535ed /program/lib/Roundcube
parent3a0dc87856cc0c2a47649e58e930621506e64cbf (diff)
Fix bugs caught by static analysis
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r--program/lib/Roundcube/rcube_addressbook.php3
-rw-r--r--program/lib/Roundcube/rcube_db_mysql.php2
-rw-r--r--program/lib/Roundcube/rcube_imap.php4
-rw-r--r--program/lib/Roundcube/rcube_imap_generic.php8
-rw-r--r--program/lib/Roundcube/rcube_spellchecker.php2
-rw-r--r--program/lib/Roundcube/rcube_vcard.php2
6 files changed, 10 insertions, 11 deletions
diff --git a/program/lib/Roundcube/rcube_addressbook.php b/program/lib/Roundcube/rcube_addressbook.php
index 84bd4bfcd..a1b29c3da 100644
--- a/program/lib/Roundcube/rcube_addressbook.php
+++ b/program/lib/Roundcube/rcube_addressbook.php
@@ -535,7 +535,7 @@ abstract class rcube_addressbook
*/
public static function compose_contact_key($contact, $sort_col)
{
- $key = $contact[$sort_col] . ':' . $row['sourceid'];
+ $key = $contact[$sort_col] . ':' . $contact['sourceid'];
// add email to a key to not skip contacts with the same name (#1488375)
if (!empty($contact['email'])) {
@@ -545,7 +545,6 @@ abstract class rcube_addressbook
return $key;
}
-
/**
* Compare search value with contact data
*
diff --git a/program/lib/Roundcube/rcube_db_mysql.php b/program/lib/Roundcube/rcube_db_mysql.php
index 8ab6403c8..de81ede98 100644
--- a/program/lib/Roundcube/rcube_db_mysql.php
+++ b/program/lib/Roundcube/rcube_db_mysql.php
@@ -147,7 +147,7 @@ class rcube_db_mysql extends rcube_db
$result = $this->query('SHOW VARIABLES');
- while ($sql_arr = $this->fetch_array($result)) {
+ while ($row = $this->fetch_array($result)) {
$this->variables[$row[0]] = $row[1];
}
}
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index c67985186..696f485eb 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -981,7 +981,7 @@ class rcube_imap extends rcube_storage
// use memory less expensive (and quick) method for big result set
$index = clone $this->index('', $this->sort_field, $this->sort_order);
// get messages uids for one page...
- $index->slice($start_msg, min($cnt-$from, $this->page_size));
+ $index->slice($from, min($cnt-$from, $this->page_size));
if ($slice) {
$index->slice(-$slice, $slice);
@@ -2727,7 +2727,7 @@ class rcube_imap extends rcube_storage
// filter folders list according to rights requirements
if ($rights && $this->get_capability('ACL')) {
- $a_folders = $this->filter_rights($a_folders, $rights);
+ $a_mboxes = $this->filter_rights($a_mboxes, $rights);
}
// filter folders and sort them
diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index db50ffbab..fd8b130db 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -1077,7 +1077,7 @@ class rcube_imap_generic
}
if (!$this->data['READ-WRITE']) {
- $this->setError(self::ERROR_READONLY, "Mailbox is read-only", 'EXPUNGE');
+ $this->setError(self::ERROR_READONLY, "Mailbox is read-only");
return false;
}
@@ -1936,7 +1936,7 @@ class rcube_imap_generic
}
if (!$this->data['READ-WRITE']) {
- $this->setError(self::ERROR_READONLY, "Mailbox is read-only", 'STORE');
+ $this->setError(self::ERROR_READONLY, "Mailbox is read-only");
return false;
}
@@ -1997,7 +1997,7 @@ class rcube_imap_generic
}
if (!$this->data['READ-WRITE']) {
- $this->setError(self::ERROR_READONLY, "Mailbox is read-only", 'STORE');
+ $this->setError(self::ERROR_READONLY, "Mailbox is read-only");
return false;
}
@@ -2508,7 +2508,7 @@ class rcube_imap_generic
$tokens = $this->tokenizeResponse(preg_replace('/(^\(|\)$)/', '', $line));
for ($i=0; $i<count($tokens); $i+=2) {
- if (preg_match('/^(BODY|BINARY)/i', $token)) {
+ if (preg_match('/^(BODY|BINARY)/i', $tokens[$i])) {
$result = $tokens[$i+1];
$found = true;
break;
diff --git a/program/lib/Roundcube/rcube_spellchecker.php b/program/lib/Roundcube/rcube_spellchecker.php
index 2b48fca92..60aec500f 100644
--- a/program/lib/Roundcube/rcube_spellchecker.php
+++ b/program/lib/Roundcube/rcube_spellchecker.php
@@ -593,7 +593,7 @@ class rcube_spellchecker
if (empty($plugin['abort'])) {
$dict = array();
- $this->rc->db->query(
+ $sql_result = $this->rc->db->query(
"SELECT data FROM ".$this->rc->db->table_name('dictionary')
." WHERE user_id ". ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL")
." AND " . $this->rc->db->quoteIdentifier('language') . " = ?",
diff --git a/program/lib/Roundcube/rcube_vcard.php b/program/lib/Roundcube/rcube_vcard.php
index cc3a35850..aded4aa78 100644
--- a/program/lib/Roundcube/rcube_vcard.php
+++ b/program/lib/Roundcube/rcube_vcard.php
@@ -90,7 +90,7 @@ class rcube_vcard
*/
public function __construct($vcard = null, $charset = RCUBE_CHARSET, $detect = false, $fieldmap = array())
{
- if (!empty($fielmap)) {
+ if (!empty($fieldmap)) {
$this->extend_fieldmap($fieldmap);
}