[geeklog-cvs] geeklog: Fixd to prevent garbled characters on comment form on a...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Fri Apr 27 15:58:38 EDT 2012
changeset 8628:fc60442b676e
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/fc60442b676e
user: dengen
date: Sat Apr 28 04:55:20 2012 +0900
description:
Fixd to prevent garbled characters on comment form on article page, due to changeset #8499 and #8500
diffstat:
public_html/lib-common.php | 5 +++--
system/lib-comment.php | 5 +++++
2 files changed, 8 insertions(+), 2 deletions(-)
diffs (31 lines):
diff -r 1e25f87d0f6b -r fc60442b676e public_html/lib-common.php
--- a/public_html/lib-common.php Thu Apr 26 23:47:39 2012 +0900
+++ b/public_html/lib-common.php Sat Apr 28 04:55:20 2012 +0900
@@ -4768,9 +4768,10 @@
$comma = ', ';
}
if (! empty($description[$tag])) {
- $retval .= $comma . COM_getTooltip('[' . $tag . ':]', $description[$tag], '', $LANG01[132],'information');
+ $desc = str_replace(array('[',']'), array('[', ']'), $description[$tag]);
+ $retval .= $comma . COM_getTooltip('[' . $tag . ':]', $desc, '', $LANG01[132],'information');
} else {
- $retval .= $comma . '[' . $tag . ':]';
+ $retval .= $comma . '[' . $tag . ':]';
}
$done_once = true;
}
diff -r 1e25f87d0f6b -r fc60442b676e system/lib-comment.php
--- a/system/lib-comment.php Thu Apr 26 23:47:39 2012 +0900
+++ b/system/lib-comment.php Sat Apr 28 04:55:20 2012 +0900
@@ -916,6 +916,11 @@
// Remove any autotags the user doesn't have permission to use
$commenttext = PLG_replaceTags($commenttext, '', true);
+ // Autotags can now be used in templates when an article is rendered
+ // for this reason, replace [, ] in order to prevent garbled characters
+ $commenttext = str_replace('[','[',$commenttext);
+ $commenttext = str_replace(']',']',$commenttext);
+
$title = COM_checkWords (strip_tags (COM_stripslashes ($title)));
// $title = str_replace('$','$',$title); done in CMT_getComment
More information about the geeklog-cvs
mailing list