24 Nov 2019, 14:51
Zen Follower
- Join Date:
- Feb 2017
- Location:
- Tokyo, Japan
- Posts:
- 334
- Plugin Contributions:
- 0
multibyte function to display truncated admin configuration values
Zen Cart 1.5.6c, MariaDB 10.3.20, PHP 7.3.11
Again, a quick fix for an issue of incorrectly-trunctated fields, this time in the configuration table displays. It occurs for me for Japanese configuration items like store address. In ADMIN/configuration.php, change the display of the value to use mb_substr instead of substr:
<td class="dataTableContent"><?php
$setting = htmlspecialchars($cfgValue, ENT_COMPAT, CHARSET, TRUE);
if (strlen($setting) > 40) {
echo mb_substr($setting,0, 35) . "...";
} else {
echo $setting;
}
?></td>
Maybe this and the related fix for sidebox display trunctions issues here
https://www.zen-cart.com/showthread.php?226127-zen_trunc_string-required-multibyte-functions
could be listed in the fixes thread.