Skip to content

Commit

Permalink
Bumped to version 1.1.16 with fix for 'wide character in print' error…
Browse files Browse the repository at this point in the history
… when upgrading templates which contain Unicode or other multibyte characters
  • Loading branch information
jayallen committed May 23, 2013
1 parent 8e6c6c3 commit 5aca7ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addons/ThemeManager.plugin/config.yaml
Expand Up @@ -4,7 +4,7 @@ key: ThemeManager
author_link: http://endevver.com/
author_name: Endevver
description: 'A comprehensive theme management plugin!'
version: 1.1.15
version: 1.1.16
schema_version: 7
static_version: 10
l10n_class: ThemeManager::L10N
Expand Down
14 changes: 12 additions & 2 deletions addons/ThemeManager.plugin/lib/ThemeManager/TemplateInstall.pm
Expand Up @@ -1492,8 +1492,18 @@ sub _upgrade_check_templates {
# Compare an MD5 hash of the templates to tell if they changed. Skip
# over any 'widgetset' template type because these have likely changed
# and we don't want to check them.
if ( $disk_tmpl->{type} ne 'widgetset'
&& md5_hex($disk_tmpl_trans) ne md5_hex($db_tmpl->text)

my ($disk_tmpl_md5, $db_tmpl_md5);
{
# Fixes 'wide character in print' error thrown by md5_hex when its
# argument contains a wide character (e.g. Unicode).
# See http://onkeypress.blogspot.com/2011/07/perl-wide-character-in-subroutine-entry.html
use bytes;
$disk_tmpl_md5 = md5_hex( $disk_tmpl_trans ."" );
$db_tmpl_md5 = md5_hex( $db_tmpl->text ."" );
}
if ( $disk_tmpl->{type} ne 'widgetset'
and $disk_tmpl_md5 ne $db_tmpl_md5
) {

# This template is going to be updated. We want to warn the user
Expand Down

0 comments on commit 5aca7ee

Please sign in to comment.