Changeset 99897b7 in github
- Timestamp:
- Feb 9, 2011 7:46:46 AM (2 years ago)
- Children:
- 57d261b
- Parents:
- dcc7900
- Files:
-
- 4 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_imap.php (modified) (1 diff)
-
program/include/rcube_imap_generic.php (modified) (3 diffs)
-
program/include/rcube_message.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rb46e5b74 r99897b7 4 4 RELEASE 0.5.1 5 5 ------------- 6 - Fix handling of attachments with invalid content type (#1487767) 7 - Add workaround for DBMail's bug http://www.dbmail.org/mantis/view.php?id=881 (#1487766) 8 - Use IMAP's ID extension (RFC2971) to print more info into debug log 6 9 - Security: add optional referer check to prevent CSRF in GET requests 7 10 - Fix email_dns_check setting not used for identities/contacts (#1487740) -
program/include/rcube_imap.php
r98cb0f1 r99897b7 149 149 $this->options['port'] = $port; 150 150 151 if ($this->options['debug']) 151 if ($this->options['debug']) { 152 152 $this->conn->setDebug(true, array($this, 'debug_handler')); 153 154 $this->options['ident'] = array( 155 'name' => 'Roundcube Webmail', 156 'version' => RCMAIL_VERSION, 157 'php' => PHP_VERSION, 158 'os' => PHP_OS, 159 'command' => $_SERVER['REQUEST_URI'], 160 ); 161 } 153 162 154 163 $attempt = 0; -
program/include/rcube_imap_generic.php
rb46e5b74 r99897b7 760 760 } 761 761 762 // Send ID info 763 if (!empty($this->prefs['ident']) && $this->getCapability('ID')) { 764 $this->id($this->prefs['ident']); 765 } 766 762 767 $auth_methods = array(); 763 768 $result = null; … … 1153 1158 if (is_array($index)) { 1154 1159 return (int) $index['COUNT']; 1160 } 1161 1162 return false; 1163 } 1164 1165 /** 1166 * Executes ID command (RFC2971) 1167 * 1168 * @param array $items Client identification information key/value hash 1169 * 1170 * @return array Server identification information key/value hash 1171 * @access public 1172 * @since 0.6 1173 */ 1174 function id($items=array()) 1175 { 1176 if (is_array($items) && !empty($items)) { 1177 foreach ($items as $key => $value) { 1178 $args[] = $this->escape($key); 1179 $args[] = $this->escape($value); 1180 } 1181 } 1182 1183 list($code, $response) = $this->execute('ID', array( 1184 !empty($args) ? '(' . implode(' ', (array) $args) . ')' : $this->escape(null) 1185 )); 1186 1187 1188 if ($code == self::ERROR_OK && preg_match('/\* ID /i', $response)) { 1189 $response = substr($response, 5); // remove prefix "* ID " 1190 $items = $this->tokenizeResponse($response); 1191 $result = null; 1192 1193 for ($i=0, $len=count($items); $i<$len; $i += 2) { 1194 $result[$items[$i]] = $items[$i+1]; 1195 } 1196 1197 return $result; 1155 1198 } 1156 1199 … … 3285 3328 return '""'; 3286 3329 } 3330 // need quoted-string? find special chars: SP, CTL, (, ), {, %, *, ", \, ] 3331 // plus [ character as a workaround for DBMail's bug (#1487766) 3287 3332 else if ($force_quotes || 3288 preg_match('/([\x00-\x20\x28-\x29\x7B\x25\x2A\x22\x5 C\x5D\x7F]+)/', $string)3333 preg_match('/([\x00-\x20\x28-\x29\x7B\x25\x2A\x22\x5B\x5C\x5D\x7F]+)/', $string) 3289 3334 ) { 3290 // string: special chars: SP, CTL, (, ), {, %, *, ", \, ]3291 3335 return '"' . strtr($string, array('"'=>'\\"', '\\' => '\\\\')) . '"'; 3292 3336 } -
program/include/rcube_message.php
rb46e5b74 r99897b7 479 479 $this->attachments[] = $mail_part; 480 480 } 481 // is a regular attachment (content-type name regexp according to RFC4288.4.2) 481 // regular attachment with valid content type 482 // (content-type name regexp according to RFC4288.4.2) 482 483 else if (preg_match('/^[a-z0-9!#$&.+^_-]+\/[a-z0-9!#$&.+^_-]+$/i', $part_mimetype)) { 483 484 if (!$mail_part->filename) 484 485 $mail_part->filename = 'Part '.$mail_part->mime_id; 486 487 $this->attachments[] = $mail_part; 488 } 489 // attachment with invalid content type 490 // replace malformed content type with application/octet-stream (#1487767) 491 else if ($mail_part->filename) { 492 $mail_part->ctype_primary = 'application'; 493 $mail_part->ctype_secondary = 'octet-stream'; 494 $mail_part->mimetype = 'application/octet-stream'; 495 485 496 $this->attachments[] = $mail_part; 486 497 }
Note: See TracChangeset
for help on using the changeset viewer.
