Index: actions/textsearch.php
===================================================================
--- actions/textsearch.php	(.../1.1.6.0)	(revision 25)
+++ actions/textsearch.php	(.../1.1.6.1)	(revision 25)
@@ -11,8 +11,8 @@
 	print("<br />");
 	$total_results = count($results);
 	$match_str = $total_results <> 1 ? " matches" : " match";
-	print("Search results: <strong>".$total_results.$match_str."</strong> for <strong>$phrase</strong><br /><br />\n");
-	if ($results) 
+	print("Search results: <strong>".$total_results.$match_str."</strong> for <strong>".$this->htmlspecialchars_ent($phrase)."</strong><br /><br />\n");
+	if ($results)
 	{
 		foreach ($results as $i => $page)
 		{
Index: actions/textsearchexpanded.php
===================================================================
--- actions/textsearchexpanded.php	(.../1.1.6.0)	(revision 25)
+++ actions/textsearchexpanded.php	(.../1.1.6.1)	(revision 25)
@@ -4,7 +4,7 @@
                 <td>Search for:&nbsp;</td>
                 <td><input name="phrase" size="40" value="<?php if (isset($_REQUEST["phrase"])) echo $this->htmlspecialchars_ent(stripslashes($_REQUEST["phrase"])); ?>" /> <input type="submit" value="Search"/></td>
         </tr>
-</table>
+</table><br />
 <?php echo $this->FormClose(); ?>
 
 <?php
@@ -11,71 +11,25 @@
 if (isset($_REQUEST["phrase"]) && $phrase = $_REQUEST["phrase"])
 {
 	$phrase = stripslashes($phrase); 
-	print("<br />");
 	$results = $this->FullTextSearch($phrase);
 	$match_str = count($results) <> 1 ? " matches" : " match";
-	print("Search results: <strong>".count($results).$match_str."</strong> for <strong>$phrase</strong><br /><br />\n");
+	print("Search results: <strong>".count($results).$match_str."</strong> for <strong>".$this->htmlspecialchars_ent($phrase)."</strong><br />\n");
 	$phrase = str_replace("\"", "", $phrase);
-      if ($results)
-      {
-                print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
-                $STORE_FORMATING_AS_TEXT = 1;
-                foreach ($results as $i => $page)
-                {
-                        //print(($i+1).". ".$this->Link($page["tag"])."<br />\n");
-                        //print implode($this->LoadPage($page["tag"]));
-                        //$matchString = preg_match("/(.{0,40}$phrase.{0,40})/",implode($this->LoadPage($page['tag'])));
-                        /* display portion of the matching body and highlight
-                           the search term */
-                        preg_match("/(.{0,120}$phrase.{0,120})/is",$page['body'],$matchString);
-                        $text = $this->htmlspecialchars_ent($matchString[0]);
-                     //   include("formatters/wakka.php");
-                        $highlightMatch = preg_replace("/($phrase)/i","<font color=\"green\"><b>$1</b></font>",$text,-1);
-                        $matchText = "<font color=\"gray\" size=\"-1\">...</font>$highlightMatch<font color=\"gray\" size=\"-1\">...</font>";
-                        print "
-
-                                          <tr>
-                                                <td valign=\"top\" align=\"right\">
-                                                  <!-- result number -->
-                                                  <table>
-                                                        <tr>
-                                                          <td valign=\"top\" align=\"left\" bgcolor=\"#DDDDDD\">
-                                                                <font color=\"white\" size=\"-3\">
-                                                                  ".($i+1)."
-                                                                </font>
-                                                          </td>
-                                                        </tr>
-                                                  </table>
-                                                </td>
-                                                <!-- link -->
-                                                <td valign=\"top\">
-                                                  ".$this->Link($page["tag"])."
-                                                </td>
-                                                <!-- date of last update -->
-                                                <td valign=\"top\" align=\"right\">
-                                                  <font color=\"gray\" size=\"-3\">
-                                                        $page[time]
-                                                  </font>
-                                                </td>
-                                          </tr>
-                                          <tr>
-                                                <td>
-                                                  &nbsp;
-                                                </td>
-                                                <td colspan=\"2\">
-                                                  $matchText
-                                                </td>
-                                          </tr>
-                                          <tr>
-                                                <td>
-                                                  &nbsp;
-                                                </td>
-                                          </tr>
-
-                                ";
-                }
-                print "</table>";
-        }
+	$phrase = preg_quote($phrase, "/");
+	if ($results)
+	{
+		foreach ($results as $i => $page)
+		{
+			/* display portion of the matching body and highlight the search term */
+			preg_match("/(.{0,120}$phrase.{0,120})/is",$page['body'],$matchString);
+			$text = $this->htmlspecialchars_ent($matchString[0]);
+			$highlightMatch = preg_replace("/($phrase)/i","<font color=\"green\"><b>$1</b></font>",$text,-1);
+			$matchText = "&hellip;".$highlightMatch."&hellip;";
+			$output .= "\n<p>".($i+1)." ".$this->Link($page["tag"])." &mdash; ".$page[time]."</p>";
+			$output .= "\n<blockquote>".$matchText."</blockquote>\n";
+		}
+	}
 }
-
+$output = $this->ReturnSafeHtml($output);
+echo $output;
 ?>
\ No newline at end of file
Index: setup/install.php
===================================================================
--- setup/install.php	(.../1.1.6.0)	(revision 25)
+++ setup/install.php	(.../1.1.6.1)	(revision 25)
@@ -267,7 +267,7 @@
 	rmdirr("safehtml");
 	rmdirr("wikiedit2");
 	rmdirr("xml");
-case "1.1.6.0-beta4":
+case "1.1.6.0":
 
 }
 
Index: docs/CHANGES.txt
===================================================================
--- docs/CHANGES.txt	(.../1.1.6.0)	(revision 25)
+++ docs/CHANGES.txt	(.../1.1.6.1)	(revision 25)
@@ -1,3 +1,22 @@
+Wikka 1.1.6.1
+
+Released on December 23, 2005 - Security release
+
+This release addresses a vulnerability issue. Thanks to DotMG for providing the security patch.
+
+Bug fix:
+
+# Fixed a XSS security bug in the search actions.
+    * Files modified: actions/textsearch.php, actions/textsearchexpanded.php 
+
+Misc:
+
+# Changed default write ACL to '+'.
+    * File modified: wikka.php 
+# Shorter and improved code for expanded search.
+    * File modified: actions/textsearchexpanded.php
+
+
 Wikka 1.1.6.0
 
 Released on January 24, 2005 - "The ever growing release"
Index: wikka.php
===================================================================
--- wikka.php	(.../1.1.6.0)	(revision 25)
+++ wikka.php	(.../1.1.6.1)	(revision 25)
@@ -39,7 +39,7 @@
 /**
  * Defines current version.
  */
-define("WAKKA_VERSION", "1.1.6.0");
+define("WAKKA_VERSION", "1.1.6.1");
 function getmicrotime() {
 	list($usec, $sec) = explode(" ", microtime());
 	return ((float)$usec + (float)$sec);
@@ -1098,7 +1098,7 @@
 
 	"wikiping_server" 		=> "",
 
-	"default_write_acl"		=> "*",
+	"default_write_acl"		=> "+",
 	"default_read_acl"		=> "*",
 	"default_comment_acl"		=> "*");
 
