[geeklog-hg] geeklog: Fixed [code] tag is encoded incorrectly. (also [raw] ta...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Wed Jun 19 12:08:47 EDT 2013
changeset 9102:7f57f14d9351
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/7f57f14d9351
user: dengen
date: Thu Jun 20 01:07:43 2013 +0900
description:
Fixed [code] tag is encoded incorrectly. (also [raw] tag) (bug #0001619)
diffstat:
public_html/lib-common.php | 10 +++++++---
system/classes/story.class.php | 15 +++++++++++++++
2 files changed, 22 insertions(+), 3 deletions(-)
diffs (55 lines):
diff -r 70e6f24c59f5 -r 7f57f14d9351 public_html/lib-common.php
--- a/public_html/lib-common.php Tue Jun 18 18:07:22 2013 -0400
+++ b/public_html/lib-common.php Thu Jun 20 01:07:43 2013 +0900
@@ -3780,12 +3780,16 @@
*/
function COM_handleCode( $str )
{
- $search = array( '&', '\\', '<', '>', '[', ']' );
- $replace = array( '&', '\', '<', '>', '[', ']' );
+
+ // note that bug fixes are included in this function (Issue #0001619)
+ // '\' -> '\' -> '\'
+ // '$' -> '$' -> '$'
+ $search = array('&', '\', '$', '\\', '<', '>', '[', ']' );
+ $replace = array('&', '\', '$', '\', '<', '>', '[', ']');
$str = str_replace( $search, $replace, $str );
- return( $str );
+ return $str;
}
/**
diff -r 70e6f24c59f5 -r 7f57f14d9351 system/classes/story.class.php
--- a/system/classes/story.class.php Tue Jun 18 18:07:22 2013 -0400
+++ b/system/classes/story.class.php Thu Jun 20 01:07:43 2013 +0900
@@ -421,6 +421,9 @@
// Store the original SID
$this->_originalSid = $this->_sid;
+
+ // Fix incorrect strings
+ $this->_fixData();
}
/**
@@ -2219,6 +2222,18 @@
}
}
+ /**
+ * replace incorrect strings that have already been stored in the database
+ * (Issue #0001619)
+ */
+ function _fixData()
+ {
+ $search = array('\', '$');
+ $replace = array('\', '$');
+ $this->_introtext = str_replace($search, $replace, $this->_introtext);
+ $this->_bodytext = str_replace($search, $replace, $this->_bodytext);
+ }
+
// End Private Methods.
/**************************************************************************/
More information about the geeklog-cvs
mailing list