#6152: App.encoding
---------------------------+------------------------------------------------
Reporter: qq71151461 | Owner:
Type: Bug | Status: new
Priority: Critical | Milestone: 1.2.x.x
Component: General | Version: 1.2 Final
Severity: Normal | Resolution:
Keywords: | Php_version: n/a
Cake_version: |
---------------------------+------------------------------------------------
Comment (by qq71151461):
Because HtmlHelper::link() escapeTitle default used h()
{{{
function link($title, $url = null, $htmlAttributes = array(),
$confirmMessage = false, $escapeTitle = true) {
if ($url !== null) {
$url = $this->url($url);
} else {
$url = $this->url($title);
$title = $url;
$escapeTitle = false;
}
if (isset($htmlAttributes['escape']) && $escapeTitle ==
true) {
$escapeTitle = $htmlAttributes['escape'];
}
if ($escapeTitle === true) {
$title = h($title);
} elseif (is_string($escapeTitle)) {
$title = htmlentities($title, ENT_QUOTES,
$escapeTitle);
}
...
}}}
basics.php
{{{
function h($text, $charset = null) {
if (is_array($text)) {
return array_map('h', $text);
}
if (empty($charset)) {
$charset = Configure::read('App.encoding');
}
if (empty($charset)) {
$charset = 'UTF-8';
}
return htmlspecialchars($text, ENT_QUOTES, $charset);
}
}}}
l10n.php
{{{
function __setLanguage($language = null) {
$langKey = null;
if ($language !== null &&
isset($this->__l10nMap[$language]) &&
isset($this->__l10nCatalog[$this->__l10nMap[$language]])) {
$langKey = $this->__l10nMap[$language];
} else if ($language !== null &&
isset($this->__l10nCatalog[$language])) {
$langKey = $language;
} else if (defined('DEFAULT_LANGUAGE')) {
$langKey = DEFAULT_LANGUAGE;
}
if ($langKey !== null &&
isset($this->__l10nCatalog[$langKey])) {
$this->language =
$this->__l10nCatalog[$langKey]['language'];
$this->languagePath = array(
$this->__l10nCatalog[$langKey]['locale'],
$this->__l10nCatalog[$langKey]['localeFallback']
);
$this->lang = $language;
$this->locale =
$this->__l10nCatalog[$langKey]['locale'];
'''$this->charset =
$this->__l10nCatalog[$langKey]['charset'];'''
} else {
$this->lang = $language;
$this->languagePath = array($language);
}
if ($this->default) {
if (isset($this->__l10nMap[$this->default]) &&
isset($this->__l10nCatalog[$this->__l10nMap[$this->default]])) {
$this->languagePath[] =
$this->__l10nCatalog[$this->__l10nMap[$this->default]]['localeFallback'];
} else if
(isset($this->__l10nCatalog[$this->default])) {
$this->languagePath[] =
$this->__l10nCatalog[$this->default]['localeFallback'];
}
}
$this->found = true;
if (Configure::read('Config.language') === null) {
Configure::write('Config.language', $this->lang);
}
'''Configure::write('App.encoding', $this->charset);'''
if ($language) {
return $language;
}
}
}}}
--
Ticket URL: <https://trac.cakephp.org/ticket/6152#comment:3>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---