comparison program/lib/Roundcube/rcube_washtml.php @ 27:c32b53434b47

more compensation for deprecated empty cases
author Charlie Root
date Sun, 18 Jan 2026 14:20:29 -0500
parents 303b85d5b561
children
comparison
equal deleted inserted replaced
25:bea5a38be938 27:c32b53434b47
212 /** 212 /**
213 * Class constructor 213 * Class constructor
214 */ 214 */
215 public function __construct($p = array()) 215 public function __construct($p = array())
216 { 216 {
217 $this->_html_elements = array_flip((array)$p['html_elements']) + array_flip(self::$html_elements); 217 $this->_html_elements = array_flip((array)($p['html_elements']??array())) + array_flip(self::$html_elements);
218 $this->_html_attribs = array_flip((array)$p['html_attribs']??array()) + array_flip(self::$html_attribs); 218 $this->_html_attribs = array_flip((array)($p['html_attribs']??array())) + array_flip(self::$html_attribs);
219 $this->_ignore_elements = array_flip((array)$p['ignore_elements']??array()) + array_flip(self::$ignore_elements); 219 $this->_ignore_elements = array_flip((array)($p['ignore_elements']??array())) + array_flip(self::$ignore_elements);
220 $this->_void_elements = array_flip((array)$p['void_elements']??array()) + array_flip(self::$void_elements); 220 $this->_void_elements = array_flip((array)($p['void_elements']??array())) + array_flip(self::$void_elements);
221 221
222 unset($p['html_elements'], $p['html_attribs'], $p['ignore_elements'], $p['void_elements']); 222 unset($p['html_elements'], $p['html_attribs'], $p['ignore_elements'], $p['void_elements']);
223 223
224 $this->config = $p + array('show_washed' => true, 'allow_remote' => false, 'cid_map' => array()); 224 $this->config = $p + array('show_washed' => true, 'allow_remote' => false, 'cid_map' => array());
225 } 225 }
365 * Wash URI value 365 * Wash URI value
366 */ 366 */
367 private function wash_uri($uri, $blocked_source = false) 367 private function wash_uri($uri, $blocked_source = false)
368 { 368 {
369 if (!empty($this->config) && 369 if (!empty($this->config) &&
370 (($src = $this->config['cid_map'][$uri]) 370 (($src = ($this->config['cid_map'][$uri]??null)) ||
371 || ($src = $this->config['cid_map'][$this->config['base_url'].$uri])) 371 ($src = ($this->config['cid_map'][$this->config['base_url'].$uri]??null)))
372 ) { 372 ) {
373 return $src; 373 return $src;
374 } 374 }
375 375
376 // allow url(#id) used in SVG 376 // allow url(#id) used in SVG
773 } 773 }
774 774
775 $style = trim($style); 775 $style = trim($style);
776 $strlen = strlen($style); 776 $strlen = strlen($style);
777 $result = array(); 777 $result = array();
778 $q = false;
778 779
779 // explode value 780 // explode value
780 for ($p=$i=0; $i < $strlen; $i++) { 781 for ($p=$i=0; $i < $strlen; $i++) {
781 if (($style[$i] == "\"" || $style[$i] == "'") && $style[$i-1] != "\\") { 782 if (($style[$i] == "\"" || $style[$i] == "'") && $style[$i-1] != "\\") {
782 if ($q == $style[$i]) { 783 if ($q == $style[$i]) {