[geeklog-cvs] geeklog: Added COM_undoSpecialChars() to introtext and bodytext ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Mar 12 09:31:54 EST 2011


changeset 8151:3435be62ad3b
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/3435be62ad3b
user: Tom <websitemaster at cogeco.net>
date: Sat Mar 12 09:31:23 2011 -0500
description:
Added COM_undoSpecialChars() to introtext and bodytext (Patch by Suprsidr)

diffstat:

 system/lib-story.php |  18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diffs (43 lines):

diff -r 579663fdbe7a -r 3435be62ad3b system/lib-story.php
--- a/system/lib-story.php	Sat Mar 12 09:20:10 2011 -0500
+++ b/system/lib-story.php	Sat Mar 12 09:31:23 2011 -0500
@@ -80,19 +80,18 @@
         $storytpl = 'storytext.thtml';
     }
 
-    $introtext = $story->displayElements('introtext');
-    if (($index == 'n') || ($index == 'p')) {
-        $bodytext = $story->displayElements('bodytext');
-    } else {
-        // for the index page, we don't need the body text anyway
-        // also saves processing autotags
+    $introtext = COM_undoSpecialChars($story->displayElements('introtext'));
+    $bodytext = COM_undoSpecialChars($story->displayElements('bodytext'));
+    $readmore = empty($bodytext)?0:1;
+    $numwords = COM_numberFormat(count(explode(' ', COM_getTextContent($bodytext))));
+    if (COM_onFrontpage()) {
         $bodytext = '';
     }
 
     if( !empty( $query ))
     {
-        $introtext = COM_highlightQuery( $introtext, $query );
-        $bodytext  = COM_highlightQuery( $bodytext, $query );
+        $introtext = COM_highlightQuery( COM_undoSpecialChars($introtext), $query );
+        $bodytext  = COM_highlightQuery( COM_undoSpecialChars($bodytext), $query );
     }
 
 
@@ -327,11 +326,10 @@
         $article->set_var( 'story_text_no_br', $introtext );
         $article->set_var( 'story_introtext_only', $introtext );
 
-        if( !empty( $bodytext ))
+        if($readmore)
         {
             $article->set_var( 'lang_readmore', $LANG01[2] );
             $article->set_var( 'lang_readmore_words', $LANG01[62] );
-            $numwords = COM_numberFormat(count(explode(' ', COM_getTextContent($bodytext))));
             $article->set_var( 'readmore_words', $numwords );
 
             $article->set_var( 'readmore_link',



More information about the geeklog-cvs mailing list