Don't have an account yet? You can create one, it is free, just click here
as a registered user you have some advantages like free downloads, comments and posting on our forums, depending upon this site's configuration and options.
Joined: Mar 15, 2005
Posts: 102
Location: Spain
Member
 Posted:
Aug 23, 2007 - 10:27 PM
Post subject: Fix for AutoTheme/render and UTF-8 (MDLite & MDP 1.07x)
This is a fix a condition where AutoTheme wouldn't detect the blocks (e.g. md_blocks) table has been properly updated when the MySQL table used the UTF-8 character set/encoding. This happened because MySQL reports 3*255 as $field->max_length, not 255.
For MDPro 1.07x: Replace this function in modules/AutoTheme/includes/md-pro/atAdmin.php
For MDLite: Replace this function in modules/Autorender/includes/atExtended.php
Rationale: The function was checking for $field->max_length == 255, a sign that the table has been updated to hold the allowable values for block positions (now strings). MySQL (possibly wrongly) returns this size in octets, not characters. Since MySQL supports just UCS-2, its longest UTF-8 character spans over 3 octets, and the maximum octet count for a 255 character UTF-8 string is 255 * 3 = 765 octets. This patch changes this line to check whether the field maximum length is equal or greater than 255, which fits AutoTheme's purpose and works with MySQL in both UTF-8 and legacy character sets/encodings, as well as other databases.
TiMax Project Manager
Joined: July 31, 2003
Posts: 1552
Location: Quebec - Canada
 Posted:
Aug 24, 2007 - 11:20 PM
Thanks man, we will check it to include your contribution with MDPro 1.082
_________________ TiMaxMAX s.o.s.Fantasia e dinamicità Italiane, qualità e servizi Canadesi Web Services, hosting ed housing professionali