- Fixed: FS#3013 - PHP 5.5 compatibility
| | |
| | | $this->_is_signed = true; |
| | | } |
| | | |
| | | private function _char_to_hex($matches) { |
| | | return '=' . strtoupper(dechex(ord($matches[1]))); |
| | | } |
| | | |
| | | /** |
| | | * Function to encode a header if necessary |
| | | * according to RFC2047 |
| | |
| | | private function _encodeHeader($input, $charset = 'ISO-8859-1') { |
| | | preg_match_all('/(\s?\w*[\x80-\xFF]+\w*\s?)/', $input, $matches); |
| | | foreach ($matches[1] as $value) { |
| | | $replacement = preg_replace('/([\x20\x80-\xFF])/e', '"=" . strtoupper(dechex(ord("\1")))', $value); |
| | | $replacement = preg_replace_callback('/([\x20\x80-\xFF])/', array($this, '_char_to_hex'), $value); |
| | | $input = str_replace($value, '=?' . $charset . '?Q?' . $replacement . '?=', $input); |
| | | } |
| | | |
| | |
| | | $regex.= '[\"\']?'; |
| | | $regex.= ')?\s*'; |
| | | $regex.= '(?:>|\/>|}|-->){1}'; |
| | | $regex.= '([\r\n|\n|\r])?/ie'; |
| | | $data = preg_replace($regex,"\$this->_parseTag(array('\\0','\\1','\\2','\\3','\\4','\\5','\\6','\\7','\\8','\\9'));",$data); |
| | | $regex.= '([\r\n|\n|\r])?/i'; |
| | | $data = preg_replace_callback($regex, array($this, _parseTag), $data); |
| | | |
| | | if ($this->_cache) { // add cache if need be |
| | | $this->_createCache($data); |
| | |
| | | $regex.= '(?:>|\/>|}|-->){1}'; |
| | | $regex.= '/ie'; |
| | | //$regex.= '([\r\n|\n|\r])?/ie'; |
| | | $data = preg_replace($regex,"\$this->_parseTag(array('\\0','\\1','\\2','\\3','\\4','\\5','\\6','\\7','\\8','\\9'));",$data); |
| | | $data = preg_replace_callback($regex, array($this, '_parseTag'), $data); |
| | | |
| | | if ($this->_cache) { // add cache if need be |
| | | $this->_createCache($data); |