mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-10 05:22:41 +00:00
Merge branch 'master' into 2.3
This commit is contained in:
commit
e59555a66f
12 changed files with 141 additions and 24 deletions
|
@ -150,7 +150,17 @@ class CacheHelper extends AppHelper {
|
|||
|
||||
if ($cacheTime != '' && $cacheTime > 0) {
|
||||
$cached = $this->_parseOutput($out);
|
||||
$this->_writeFile($cached, $cacheTime, $useCallbacks);
|
||||
try {
|
||||
$this->_writeFile($cached, $cacheTime, $useCallbacks);
|
||||
} catch (Exception $e) {
|
||||
$message = __d(
|
||||
'cake_dev',
|
||||
'Unable to write view cache file: "%s" for "%s"',
|
||||
$e->getMessage(),
|
||||
$this->request->here
|
||||
);
|
||||
$this->log($message, 'error');
|
||||
}
|
||||
$out = $this->_stripTags($out);
|
||||
}
|
||||
return $out;
|
||||
|
|
|
@ -256,6 +256,8 @@ class RssHelper extends AppHelper {
|
|||
$attrib = $val;
|
||||
$val = null;
|
||||
break;
|
||||
default:
|
||||
$attrib = $att;
|
||||
}
|
||||
if (!is_null($val) && $escape) {
|
||||
$val = h($val);
|
||||
|
@ -312,7 +314,12 @@ class RssHelper extends AppHelper {
|
|||
|
||||
$xml = '<' . $name;
|
||||
if (!empty($namespace)) {
|
||||
$xml .= ' xmlns:"' . $namespace . '"';
|
||||
$xml .= ' xmlns';
|
||||
if (is_array($namespace)) {
|
||||
$xml .= ':' . $namespace['prefix'];
|
||||
$namespace = $namespace['url'];
|
||||
}
|
||||
$xml .= '="' . $namespace . '"';
|
||||
}
|
||||
$bareName = $name;
|
||||
if (strpos($name, ':') !== false) {
|
||||
|
@ -329,8 +336,10 @@ class RssHelper extends AppHelper {
|
|||
$xml .= '>' . $content . '</' . $name . '>';
|
||||
$elem = Xml::build($xml, array('return' => 'domdocument'));
|
||||
$nodes = $elem->getElementsByTagName($bareName);
|
||||
foreach ($attrib as $key => $value) {
|
||||
$nodes->item(0)->setAttribute($key, $value);
|
||||
if ($attrib) {
|
||||
foreach ($attrib as $key => $value) {
|
||||
$nodes->item(0)->setAttribute($key, $value);
|
||||
}
|
||||
}
|
||||
foreach ($children as $k => $child) {
|
||||
$child = $elem->createElement($name, $child);
|
||||
|
|
|
@ -101,8 +101,9 @@ class TextHelper extends AppHelper {
|
|||
$this->_placeholders = array();
|
||||
$options += array('escape' => true);
|
||||
|
||||
$pattern = '#(?<!href="|src="|">)((?:https?|ftp|nntp)://[^\s<>()]+\.[a-z]+(?:\/[^\s]+)?)#i';
|
||||
$text = preg_replace_callback(
|
||||
'#(?<!href="|src="|">)((?:https?|ftp|nntp)://[^\s<>()]+)#i',
|
||||
$pattern,
|
||||
array(&$this, '_insertPlaceHolder'),
|
||||
$text
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue