#2218: multibyte strings should be supported
----------------------------+-----------------------------------------------
Reporter: Rik | Owner: phpnut
Type: Enhancement | Status: new
Priority: High | Milestone: 1.3.x.x
Component: General | Version:
Severity: Major | Resolution:
Keywords: | Php_version: PHP 4 >= 4.3.0
Cake_version: |
----------------------------+-----------------------------------------------
Comment (by euromark):
i am very glad this will finally be an issue of high priority in 1.3
:)[[BR]]
in summer 2008, i already pointed out how severe this issue might effect
any website built with cake.
[[BR]]
[[BR]]
since this time i had to continuously hack into the core validation.php in
order to ensure correct validation (replaced str() functions with mb_str()
functions)
[[BR]]
[[BR]]
some people in America will now think, who cares, my site is only visited
by American fellows.[[BR]]
well, the visitors still could inject multibyte characters such as äöü
into forms which usually results in incorrect validation[[BR]]
what i want to say is, that the multibyte functions should not only be
fully supported, but also be 100% integrated into the core.
[[BR]]
[[BR]]
here is what is neccessary to ensure proper "woldwide" validation (if utf8
is your encoding):
[[BR]]
[[BR]]
a)
[[BR]]
mb_internal_encoding('UTF-8'); # important!
[[BR]]
(could be invoked by setting Configure::App.encoding to UTF-8)
[[BR]]
[[BR]]
b)
[[BR]]
in /libs/validation.php (one example on the between validation):
{{{
function between($check, $min, $max) {
//$length = strlen($check);
$length = mb_strlen($check); # CORE-HACK 2008-09-12 ms
| now the character are counted correctly
return ($length >= $min && $length <= $max);
}
}}}
the same goes for minLength, maxLength, etc (or _luhn() for the cc
validation)
--
Ticket URL: <https://trac.cakephp.org/ticket/2218#comment:8>
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
-~----------~----~----~----~------~----~------~--~---