mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Removed all references to Router::url in all helpers. Closes #4880. Fixed failing test in RssHelper, added more tests.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7164 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
68af2bb1ed
commit
44159ec303
5 changed files with 33 additions and 11 deletions
|
@ -425,7 +425,7 @@ class HtmlHelper extends AppHelper {
|
|||
*/
|
||||
function image($path, $options = array()) {
|
||||
if (is_array($path)) {
|
||||
$path = Router::url($path);
|
||||
$path = $this->url($path);
|
||||
} elseif ($path{0} === '/') {
|
||||
$path = $this->webroot($path);
|
||||
} elseif (strpos($path, '://') !== false) {
|
||||
|
|
|
@ -281,7 +281,7 @@ class PaginatorHelper extends AppHelper {
|
|||
if ($asArray) {
|
||||
return $url;
|
||||
}
|
||||
return Router::url($url);
|
||||
return parent::url($url);
|
||||
}
|
||||
/**
|
||||
* Protected method for generating prev/next links
|
||||
|
|
|
@ -196,14 +196,14 @@ class RssHelper extends XmlHelper {
|
|||
unset($attrib['url']);
|
||||
$val = $val['url'];
|
||||
}
|
||||
$val = Router::url($val, true);
|
||||
$val = $this->url($val, true);
|
||||
break;
|
||||
case 'source':
|
||||
if (is_array($val) && isset($val['url'])) {
|
||||
$attrib['url'] = Router::url($val['url'], true);
|
||||
$attrib['url'] = $this->url($val['url'], true);
|
||||
$val = $val['title'];
|
||||
} elseif (is_array($val)) {
|
||||
$attrib['url'] = Router::url($val[0], true);
|
||||
$attrib['url'] = $this->url($val[0], true);
|
||||
$val = $val[1];
|
||||
}
|
||||
break;
|
||||
|
@ -216,13 +216,18 @@ class RssHelper extends XmlHelper {
|
|||
$val['type'] = mime_content_type(WWW_ROOT . $val['url']);
|
||||
}
|
||||
}
|
||||
$val['url'] = Router::url($val['url'], true);
|
||||
$val['url'] = $this->url($val['url'], true);
|
||||
$attrib = $val;
|
||||
$val = null;
|
||||
break;
|
||||
}
|
||||
if ($val != null) {
|
||||
$val = h($val);
|
||||
$escape = true;
|
||||
if (is_array($val) && isset($val['convertEntities'])) {
|
||||
$escape = $val['convertEntities'];
|
||||
unset($val['convertEntities']);
|
||||
}
|
||||
if (!is_null($val) && $escape) {
|
||||
$val = h($val);
|
||||
}
|
||||
$elements[$key] = $this->elem($key, $attrib, $val);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
*
|
||||
*/
|
||||
if(!class_exists('cakesession')) {
|
||||
uses('session');
|
||||
App::import('Core', 'Session');
|
||||
}
|
||||
class SessionHelper extends CakeSession {
|
||||
/**
|
||||
|
@ -148,7 +148,7 @@ class SessionHelper extends CakeSession {
|
|||
$out = $view->renderLayout($flash['message']);
|
||||
list($view->layout, $view->viewVars, $view->pageTitle) = array($tmpLayout, $tmpVars, $tmpTitle);
|
||||
}
|
||||
e($out);
|
||||
echo($out);
|
||||
parent::del('Message.' . $key);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -244,7 +244,7 @@ class RssTest extends CakeTestCase {
|
|||
$item = array(
|
||||
'title' => array(
|
||||
'value' => 'My Title & more',
|
||||
'strip' => false
|
||||
'convertEntities' => false
|
||||
)
|
||||
);
|
||||
$result = $this->Rss->item(null, $item);
|
||||
|
@ -256,6 +256,23 @@ class RssTest extends CakeTestCase {
|
|||
'/item'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
$item = array(
|
||||
'title' => array(
|
||||
'value' => 'My Title & more',
|
||||
'cdata' => true,
|
||||
'convertEntities' => false,
|
||||
)
|
||||
);
|
||||
$result = $this->Rss->item(null, $item);
|
||||
$expected = array(
|
||||
'<item',
|
||||
'<title',
|
||||
'<![CDATA[My Title & more]]',
|
||||
'/title',
|
||||
'/item'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
}
|
||||
/**
|
||||
* testTime method
|
||||
|
|
Loading…
Add table
Reference in a new issue