#6042: correct outlining of encoding in the form tag
----------------------------+-----------------------------------------------
Reporter: euromark | Owner:
Type: Enhancement | Status: new
Priority: Low | Milestone: 1.3.x.x
Component: General | Version:
Severity: Normal | Resolution:
Keywords: | Php_version: n/a
Cake_version: |
----------------------------+-----------------------------------------------
Changes (by renan.saddam):
* version: 1.2 Final =>
* milestone: 1.2.x.x => 1.3.x.x
Old description:
> usually a form looks like this (even with App.encoding set to utf-8
> {{{
> <form id="XForm" method="post" action="/x/add">
> }}}[[BR]]
>
> this should be done automatically - especially as all UTF-8 forms (with
> Ajax Submitting or not) should have it declared as utf-8
> [[BR]]
> [[BR]]
>
> this enhancement inside the "form helper function" create() in
> /libs/view/helpers/form.php fixes this:
> {{{
> function create($model = null, $options = array()) {
> $defaultModel = null;
> $view =& ClassRegistry::getObject('view');
>
> if (is_array($model) && empty($options)) {
> $options = $model;
> $model = null;
> }
>
> /** CORE-HACK 2009-01-22 ms / correct form encoding */
> $encoding = Configure::read('App.encoding');
> if (!empty($encoding)) {
> $options['accept-charset'] = low($encoding);
> }
> /** CORE-HACK 2009-01-22 end */
>
> if (empty($model) && $model !== false &&
> !empty($this->params['models'])) {
> ...
> }}}
> [[BR]]
>
> it now looks like this:
> {{{
> <form accept-charset="utf-8" id="XForm" method="post" action="/x/add">
> }}}
New description:
usually a form looks like this (even with App.encoding set to utf-8)
{{{
<form id="XForm" method="post" action="/x/add">
}}}
[[BR]]
this should be done automatically - especially as all UTF-8 forms (with
Ajax Submitting or not) should have it declared as utf-8)
[[BR]]
[[BR]]
this enhancement inside the "form helper function" create() in
/libs/view/helpers/form.php fixes this:
{{{
function create($model = null, $options = array()) {
$defaultModel = null;
$view =& ClassRegistry::getObject('view');
if (is_array($model) && empty($options)) {
$options = $model;
$model = null;
}
/** CORE-HACK 2009-01-22 ms / correct form encoding */
$encoding = Configure::read('App.encoding');
if (!empty($encoding)) {
$options['accept-charset'] = low($encoding);
}
/** CORE-HACK 2009-01-22 end */
if (empty($model) && $model !== false &&
!empty($this->params['models'])) {
...
}}}
[[BR]]
it now looks like this:
{{{
<form accept-charset="utf-8" id="XForm" method="post" action="/x/add">
}}}
Comment:
Just formatting.
--
Ticket URL: <https://trac.cakephp.org/ticket/6042#comment:2>
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
-~----------~----~----~----~------~----~------~--~---