Changeset 0a1dd5b in github
- Timestamp:
- May 22, 2012 5:07:20 AM (12 months ago)
- Branches:
- master, HEAD, dev-browser-capabilities, pdo
- Children:
- 041c93c
- Parents:
- 5a575b7
- Files:
-
- 5 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/html.php (modified) (4 diffs)
-
program/include/rcmail.php (modified) (4 diffs)
-
program/steps/mail/compose.inc (modified) (1 diff)
-
program/steps/settings/edit_identity.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r5c7e54b r0a1dd5b 2 2 =========================== 3 3 4 - Add is_escaped attribute for html_select and html_textarea (#1488485) 4 5 - Fix HTML entities handling in HTML editor (#1488483) 5 6 - Fix listing shared folders on Courier IMAP (#1488466) -
program/include/html.php
r0c25968 r0a1dd5b 299 299 } 300 300 else { 301 $attrib_arr[] = $key . '="' . self::quote($value ) . '"';301 $attrib_arr[] = $key . '="' . self::quote($value, true) . '"'; 302 302 } 303 303 } … … 332 332 * Replacing specials characters in html attribute value 333 333 * 334 * @param string $str Input string 334 * @param string $str Input string 335 * @param bool $validate Enables double quotation prevention 335 336 * 336 337 * @return string The quoted string 337 338 */ 338 public static function quote($str )339 public static function quote($str, $validate = false) 339 340 { 340 341 $str = htmlspecialchars($str, ENT_COMPAT, RCMAIL_CHARSET); 341 342 342 343 // avoid douple quotation of & 343 // @TODO: get rid of it? 344 $str = preg_replace('/&([A-Za-z]{2,6}|#[0-9]{2,4});/', '&\\1;', $str); 344 // @TODO: get rid of it 345 if ($validate) { 346 $str = preg_replace('/&([A-Za-z]{2,6}|#[0-9]{2,4});/', '&\\1;', $str); 347 } 345 348 346 349 return $str; … … 559 562 } 560 563 561 if (!empty($value) && !preg_match('/mce_editor/', $this->attrib['class'])) {562 $value = self::quote($value );564 if (!empty($value) && empty($this->attrib['is_escaped'])) { 565 $value = self::quote($value, true); 563 566 } 564 567 … … 634 637 in_array($option['text'], $select, true)) ? 1 : null); 635 638 636 $this->content .= self::tag('option', $attr, self::quote($option['text'])); 639 $option_content = $option['text']; 640 if (empty($this->attrib['is_escaped'])) { 641 $option_content = self::quote($option_content, true); 642 } 643 644 $this->content .= self::tag('option', $attr, $option_content); 637 645 } 638 646 -
program/include/rcmail.php
r5a575b7 r0a1dd5b 1330 1330 1331 1331 if ($type == 'select') { 1332 $attrib['is_escaped'] = true; 1332 1333 $select = new html_select($attrib); 1333 1334 1334 1335 // add no-selection option 1335 1336 if ($attrib['noselection']) { 1336 $select->add( $rcmail->gettext($attrib['noselection']), '');1337 $select->add(html::quote($rcmail->gettext($attrib['noselection'])), ''); 1337 1338 } 1338 1339 … … 1363 1364 public function folder_selector($p = array()) 1364 1365 { 1365 $p += array('maxlength' => 100, 'realnames' => false );1366 $p += array('maxlength' => 100, 'realnames' => false, 'is_escaped' => true); 1366 1367 $a_mailboxes = array(); 1367 1368 $storage = $this->get_storage(); … … 1389 1390 1390 1391 if ($p['noselection']) { 1391 $select->add( $p['noselection'], '');1392 $select->add(html::quote($p['noselection']), ''); 1392 1393 } 1393 1394 … … 1580 1581 } 1581 1582 1582 $select->add(str_repeat(' ', $nestLevel*4) . $foldername, $folder['id']);1583 $select->add(str_repeat(' ', $nestLevel*4) . html::quote($foldername), $folder['id']); 1583 1584 1584 1585 if (!empty($folder['folders'])) { -
program/steps/mail/compose.inc
r5c7e54b r0a1dd5b 773 773 $MESSAGE_BODY = htmlentities($MESSAGE_BODY, ENT_NOQUOTES, RCMAIL_CHARSET); 774 774 $attrib['class'] = 'mce_editor'; 775 $attrib['is_escaped'] = true; 775 776 $textarea = new html_textarea($attrib); 776 777 $out .= $textarea->show($MESSAGE_BODY); -
program/steps/settings/edit_identity.inc
r5c7e54b r0a1dd5b 89 89 // Enable TinyMCE editor 90 90 if ($IDENTITY_RECORD['html_signature']) { 91 $form['signature']['content']['signature']['class'] = 'mce_editor'; 91 $form['signature']['content']['signature']['class'] = 'mce_editor'; 92 $form['signature']['content']['signature']['is_escaped'] = true; 92 93 } 93 94
Note: See TracChangeset
for help on using the changeset viewer.
