Changeset 86df152 in github
- Timestamp:
- Dec 29, 2006 4:06:39 PM (6 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- e93a2d7
- Parents:
- 3b12aee
- Files:
-
- 9 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/main.inc (modified) (2 diffs)
-
program/include/rcube_shared.inc (modified) (14 diffs)
-
program/localization/de_CH/labels.inc (modified) (3 diffs)
-
program/localization/de_CH/messages.inc (modified) (2 diffs)
-
program/localization/en_US/messages.inc (modified) (1 diff)
-
program/steps/mail/compose.inc (modified) (1 diff)
-
program/steps/mail/func.inc (modified) (1 diff)
-
program/steps/mail/upload.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
ree883ad r86df152 1 1 CHANGELOG RoundCube Webmail 2 2 --------------------------- 3 4 2006/12/29 (thomasb) 5 ---------- 6 - Added error handling for attachment uploads 7 - Use multibyte safe string functions where necessary (closes #1483988) 8 - Updated Swiss German localization (de_CH) 9 3 10 4 11 2006/12/22 (thomasb) -
program/include/main.inc
ree883ad r86df152 401 401 function rcmail_set_locale($lang) 402 402 { 403 global $OUTPUT, $ MBSTRING;403 global $OUTPUT, $CHARSET, $MBSTRING; 404 404 static $s_mbstring_loaded = NULL; 405 405 … … 409 409 else 410 410 $MBSTRING = $s_mbstring_loaded = FALSE; 411 412 if ($MBSTRING) 413 mb_internal_encoding($CHARSET); 411 414 412 415 $OUTPUT->set_charset(rcube_language_prop($lang, 'charset')); -
program/include/rcube_shared.inc
r2bca6e1 r86df152 6 6 | | 7 7 | This file is part of the RoundCube PHP suite | 8 | Copyright (C) 2005 , RoundCube Dev. - Switzerland|8 | Copyright (C) 2005-2006, RoundCube Dev. - Switzerland | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 130 130 131 131 // set default page title 132 if ( !strlen($this->title))132 if (empty($this->title)) 133 133 $this->title = 'RoundCube Mail'; 134 134 … … 159 159 } 160 160 161 if ( strlen($this->scripts['head']))161 if (!empty($this->scripts['head'])) 162 162 $__page_header .= sprintf($this->script_tag, $this->scripts['head']); 163 163 … … 168 168 } 169 169 170 if ( strlen($this->scripts['foot']))170 if (!empty($this->scripts['foot'])) 171 171 $__page_footer .= sprintf($this->script_tag, $this->scripts['foot']); 172 172 … … 177 177 178 178 // find page header 179 if($hpos = strpos(strtolower($output), '</head>'))179 if($hpos = rc_strpos(rc_strtolower($output), '</head>')) 180 180 $__page_header .= "\n"; 181 181 else 182 182 { 183 183 if (!is_numeric($hpos)) 184 $hpos = strpos(strtolower($output), '<body');185 if (!is_numeric($hpos) && ($hpos = strpos(strtolower($output), '<html')))184 $hpos = rc_strpos(rc_strtolower($output), '<body'); 185 if (!is_numeric($hpos) && ($hpos = rc_strpos(rc_strtolower($output), '<html'))) 186 186 { 187 187 while($output[$hpos]!='>') … … 195 195 // add page hader 196 196 if($hpos) 197 $output = substr($output,0,$hpos) . $__page_header . substr($output,$hpos,strlen($output));197 $output = rc_substr($output,0,$hpos) . $__page_header . rc_substr($output,$hpos,rc_strlen($output)); 198 198 else 199 199 $output = $__page_header . $output; … … 201 201 202 202 // find page body 203 if($bpos = strpos(strtolower($output), '<body'))203 if($bpos = rc_strpos(rc_strtolower($output), '<body')) 204 204 { 205 205 while($output[$bpos]!='>') $bpos++; … … 207 207 } 208 208 else 209 $bpos = strpos(strtolower($output), '</head>')+7;209 $bpos = rc_strpos(rc_strtolower($output), '</head>')+7; 210 210 211 211 // add page body 212 212 if($bpos && $__page_body) 213 $output = substr($output,0,$bpos) . "\n$__page_body\n" . substr($output,$bpos,strlen($output));213 $output = rc_substr($output,0,$bpos) . "\n$__page_body\n" . rc_substr($output,$bpos,rc_strlen($output)); 214 214 215 215 216 216 // find and add page footer 217 $output_lc = strtolower($output);217 $output_lc = rc_strtolower($output); 218 218 if(($fpos = strrstr($output_lc, '</body>')) || 219 219 ($fpos = strrstr($output_lc, '</html>'))) 220 $output = substr($output,0,$fpos) . "$__page_footer\n" .substr($output,$fpos);220 $output = rc_substr($output,0,$fpos) . "$__page_footer\n" . rc_substr($output,$fpos); 221 221 else 222 222 $output .= "\n$__page_footer"; … … 879 879 unset($this->attrib['value']); 880 880 881 if ( strlen($value) && !isset($this->attrib['mce_editable']))881 if (!empty($value) && !isset($this->attrib['mce_editable'])) 882 882 $value = Q($value, 'strict', FALSE); 883 883 … … 1013 1013 foreach ($this->options as $option) 1014 1014 { 1015 $selected = (( strlen($option['value']) && in_array($option['value'], $select, TRUE)) ||1015 $selected = ((!empty($option['value']) && in_array($option['value'], $select, TRUE)) || 1016 1016 (in_array($option['text'], $select, TRUE))) ? $this->_conv_case(' selected', 'attrib') : ''; 1017 1017 1018 1018 $options_str .= sprintf("<%s%s%s>%s</%s>\n", 1019 1019 $this->_conv_case('option', 'tag'), 1020 strlen($option['value']) ? sprintf($value_str, $option['value']) : '',1020 !empty($option['value']) ? sprintf($value_str, $option['value']) : '', 1021 1021 $selected, 1022 1022 Q($option['text'], 'strict', FALSE), … … 1105 1105 $vars = isset($attrib['vars']) ? $attrib['vars'] : ''; 1106 1106 1107 $command_name = strlen($attrib['command']) ? $attrib['command'] : NULL;1107 $command_name = !empty($attrib['command']) ? $attrib['command'] : NULL; 1108 1108 $alias = $attrib['name'] ? $attrib['name'] : ($command_name && $command_label_map[$command_name] ? $command_label_map[$command_name] : ''); 1109 1109 … … 1278 1278 $value = $value ? "true" : "false"; 1279 1279 } 1280 else if ((($type=='mixed' && is_numeric($value)) || $type=='int') && strlen($value)<16) // js interprets numbers with digits >15 as ...e+...1280 else if ((($type=='mixed' && is_numeric($value)) || $type=='int') && rc_strlen($value)<16) // js interprets numbers with digits >15 as ...e+... 1281 1281 $is_string = FALSE; 1282 1282 else … … 1335 1335 1336 1336 1337 // parse a human readable string for a number of bytes 1338 function parse_bytes($str) 1339 { 1340 if (is_numeric($str)) 1341 return intval($str); 1342 1343 if (preg_match('/([0-9]+)([a-z])/i', $str, $regs)) 1344 { 1345 $bytes = floatval($regs[1]); 1346 switch (strtolower($regs[2])) 1347 { 1348 case 'g': 1349 $bytes *= 1073741824; 1350 break; 1351 case 'm': 1352 $bytes *= 1048576; 1353 break; 1354 case 'k': 1355 $bytes *= 1024; 1356 break; 1357 } 1358 } 1359 1360 return intval($bytes); 1361 } 1362 1337 1363 // create a human readable string for a number of bytes 1338 1364 function show_bytes($bytes) … … 1394 1420 1395 1421 1422 // wrapper function for strlen 1423 function rc_strlen($str) 1424 { 1425 if (function_exists('mb_strlen')) 1426 return mb_strlen($str); 1427 else 1428 return strlen($str); 1429 } 1430 1431 // wrapper function for strtolower 1432 function rc_strtolower($str) 1433 { 1434 if (function_exists('mb_strtolower')) 1435 return mb_strtolower($str); 1436 else 1437 return strtolower($str); 1438 } 1439 1440 // wrapper function for substr 1441 function rc_substr($str, $start, $len) 1442 { 1443 if (function_exists('mb_substr')) 1444 return mb_substr($str, $start, $len); 1445 else 1446 return substr($str, $start, $len); 1447 } 1448 1449 // wrapper function for strpos 1450 function rc_strpos($haystack, $needle, $offset=0) 1451 { 1452 if (function_exists('mb_strpos')) 1453 return mb_strpos($haystack, $needle, $offset); 1454 else 1455 return strpos($haystack, $needle, $offset); 1456 } 1457 1458 // wrapper function for strrpos 1459 function rc_strrpos($haystack, $needle, $offset=0) 1460 { 1461 if (function_exists('mb_strrpos')) 1462 return mb_strrpos($haystack, $needle, $offset); 1463 else 1464 return strrpos($haystack, $needle, $offset); 1465 } 1466 1467 1396 1468 // replace the middle part of a string with ... 1397 1469 // if it is longer than the allowed length 1398 1470 function abbrevate_string($str, $maxlength, $place_holder='...') 1399 1471 { 1400 $length = strlen($str);1401 $first_part_length = floor($maxlength/2) - strlen($place_holder);1472 $length = rc_strlen($str); 1473 $first_part_length = floor($maxlength/2) - rc_strlen($place_holder); 1402 1474 1403 1475 if ($length > $maxlength) 1404 1476 { 1405 1477 $second_starting_location = $length - $maxlength + $first_part_length + 1; 1406 $str = substr($str, 0, $first_part_length) . $place_holder .substr($str, $second_starting_location, $length);1478 $str = rc_substr($str, 0, $first_part_length) . $place_holder . rc_substr($str, $second_starting_location, $length); 1407 1479 } 1408 1480 -
program/localization/de_CH/labels.inc
r421f5e3 r86df152 133 133 $labels['addattachment'] = 'Datei anfÃŒgen'; 134 134 $labels['charset'] = 'Zeichensatz'; 135 $labels['editortype'] = 'Editor-Typ'; 135 136 $labels['returnreceipt'] = 'EmpfangsbestÀtigung'; 136 137 … … 151 152 $labels['nosubject'] = '(kein Betreff)'; 152 153 $labels['showimages'] = 'Bilder anzeigen'; 154 155 $labels['htmltoggle'] = 'HTML'; 156 $labels['plaintoggle'] = 'Klartext'; 153 157 154 158 … … 175 179 176 180 $labels['previouspage'] = 'Eine Seite zurÃŒck'; 181 $labels['firstpage'] = 'Erste Seite'; 177 182 $labels['nextpage'] = 'NÀchste Seite'; 183 $labels['lastpage'] = 'Letzte Seite'; 178 184 179 185 // LDAP search -
program/localization/de_CH/messages.inc
rb190970 r86df152 67 67 $messages['deletecontactconfirm'] = 'Wollen Sie die ausgewÀhlten Kontakte wirklich löschen'; 68 68 69 $messages['deletemessagesconfirm'] = 'Wollen Sie die ausgewÀhlten Nachrichten wirklich löschen?'; 70 69 71 $messages['deletefolderconfirm'] = 'Wollen Sie diesen Ordner wirklich löschen?'; 70 72 … … 111 113 $messages['messageopenerror'] = 'Die Nachricht konnte nicht vom Server geladen werden'; 112 114 115 $messages['fileuploaderror'] = 'Der Dateiupload ist fehlgeschlagen'; 116 117 $messages['filesizeerror'] = 'Die Datei ÃŒberschreitet die maximale Grösse von $size'; 118 113 119 ?> -
program/localization/en_US/messages.inc
rb190970 r86df152 115 115 $messages['messageopenerror'] = 'Could not load message from server'; 116 116 117 $messages['fileuploaderror'] = 'File upload failed'; 118 119 $messages['filesizeerror'] = 'The uploaded file exceeds the maximum size of $size'; 120 117 121 ?> -
program/steps/mail/compose.inc
r2bca6e1 r86df152 47 47 $MESSAGE = NULL; 48 48 49 // nothing below is called during message composition, only at "new/forward/reply/draft" initialization 50 // since there are many ways to leave the compose page improperly, it seems necessary to clean-up an old 49 // Nothing below is called during message composition, only at "new/forward/reply/draft" initialization or 50 // if a compose-ID is given (i.e. when the compose step is opened in a new window/tab). 51 // Since there are many ways to leave the compose page improperly, it seems necessary to clean-up an old 51 52 // compose when a "new/forward/reply/draft" is called - otherwise the old session attachments will appear 52 53 53 rcmail_compose_cleanup(); 54 $_SESSION['compose'] = array('id' => uniqid(rand())); 54 if (!is_array($_SESSION['compose']) || $_SESSION['compose']['id'] != get_input_value('_id', RCUBE_INPUT_GET)) 55 { 56 rcmail_compose_cleanup(); 57 $_SESSION['compose'] = array('id' => uniqid(rand())); 58 } 55 59 56 60 // add some labels to client -
program/steps/mail/func.inc
r3b12aee r86df152 1215 1215 { 1216 1216 $prev_body = $body; 1217 $body = preg_replace('/(<[^!][^>]*?\s)(on \w+?)(=[^>]*?>)/im', '$1__removed=$3', $body);1217 $body = preg_replace('/(<[^!][^>]*?\s)(on[^=]+)(=[^>]*?>)/im', '$1__removed=$3', $body); 1218 1218 $body = preg_replace('/(<[^!][^>]*?\shref=["\']?)(javascript:)([^>]*?>)/im', '$1null:$3', $body); 1219 1219 } -
program/steps/mail/upload.inc
rf91a499 r86df152 66 66 $content); 67 67 } 68 else // upload failed 69 { 70 $err = $_FILES['_attachments']['error'][$i]; 71 if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) 72 $msg = rcube_label(array('name' => 'filesizeerror', 'vars' => array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize')))))); 73 else 74 $msg = rcube_label('fileuploaderror'); 75 76 $response = sprintf("parent.%s.display_message('%s', 'error');", $JS_OBJECT_NAME, JQ($msg)); 77 } 68 78 } 69 79
Note: See TracChangeset
for help on using the changeset viewer.
