changeset 491:c360fb50221c

Add entity handling to stConvertCommonDesc().
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 07 Dec 2013 15:27:33 +0200
parents 505f46b8bb14
children 7d1f08ec1d45
files compos.inc.php msite.inc.php
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/compos.inc.php	Sat Dec 07 15:23:53 2013 +0200
+++ b/compos.inc.php	Sat Dec 07 15:27:33 2013 +0200
@@ -28,7 +28,7 @@
     echo
     "<div id=\"compo".$item["id"]."\">\n".
     "<h2>".chentities($item["name"])."</h2>\n".
-    stConvertCommonDesc($item["description"]).
+    stConvertCommonDesc($item["description"], FALSE).
     "</div>\n";
   }
 }
--- a/msite.inc.php	Sat Dec 07 15:23:53 2013 +0200
+++ b/msite.inc.php	Sat Dec 07 15:27:33 2013 +0200
@@ -327,7 +327,7 @@
 }
 
 
-function stConvertCommonDesc($desc)
+function stConvertCommonDesc($desc, $chent)
 {
   $str = "";
   $mode = "";
@@ -337,18 +337,18 @@
     if (preg_match("/^\s*\s*\*(.+)$/", $line, $m))
     {
       stConvSwitchMode($str, $mode, "ol");
-      $str .= "<li>".$m[1]."</li>\n";
+      $str .= "<li>".($chent ? chentities($m[1]) : $m[1])."</li>\n";
     }
     else
     if (preg_match("/^\s*-\s*(.+)$/", $line, $m))
     {
       stConvSwitchMode($str, $mode, "ul");
-      $str .= "<li>".$m[1]."</li>\n";
+      $str .= "<li>".($chent ? chentities($m[1]) : $m[1])."</li>\n";
     }
     else
     {
       stConvSwitchMode($str, $mode, "p");
-      $str .= $line;
+      $str .= ($chent ? chentities($line) : $line);
     }
   }