![]() |
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patch fix_wrong_utf_string_cut.patch for Website problem Bug #55177Patch version 2011-08-16 13:23 UTC Return to Bug #55177 | Download this patchThis patch renders other patches obsolete Obsolete patches: Patch Revisions: 2011-08-16 13:23 UTC | 2011-08-16 05:53 UTC | 2011-08-16 05:51 UTCDeveloper: irker@php.netIndex: event.php Index: entry/event.php =================================================================== --- event.php (revision 314981) +++ event.php (working copy) @@ -21,6 +21,8 @@ if (empty($sdesc) || empty($email) || empty($country) || empty($category) || empty($type) || empty($url)) die("missing some parameters."); --- entry/event.php (revision 314981) +++ entry/event.php (working copy) @@ -26,6 +26,9 @@ die("I feel for you"); } +$sdesc = mb_strcut($sdesc, 0, 32); +// utf8 safe truncate, while php not compile with mb_string +$l = 32; while (strlen($sdesc) > 32) { $sdesc = iconv_substr($sdesc, 0, $l--, 'UTF-8'); } + // The answer to the "spam question" if ($sane != 3) { die("I feel for you"); @mysql_connect("localhost","nobody", "") or die("failed to connect to database"); @mysql_select_db("phpmasterdb") |
![]() All rights reserved. |
Last updated: Tue Feb 11 07:01:31 2025 UTC |