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("
"); $total_results = count($results); $match_str = $total_results <> 1 ? " matches" : " match"; - print("Search results: ".$total_results.$match_str." for $phrase

\n"); - if ($results) + print("Search results: ".$total_results.$match_str." for ".$this->htmlspecialchars_ent($phrase)."

\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 @@ Search for:  htmlspecialchars_ent(stripslashes($_REQUEST["phrase"])); ?>" /> - +
FormClose(); ?> "); $results = $this->FullTextSearch($phrase); $match_str = count($results) <> 1 ? " matches" : " match"; - print("Search results: ".count($results).$match_str." for $phrase

\n"); + print("Search results: ".count($results).$match_str." for ".$this->htmlspecialchars_ent($phrase)."
\n"); $phrase = str_replace("\"", "", $phrase); - if ($results) - { - print ""; - $STORE_FORMATING_AS_TEXT = 1; - foreach ($results as $i => $page) - { - //print(($i+1).". ".$this->Link($page["tag"])."
\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","$1",$text,-1); - $matchText = "...$highlightMatch..."; - print " - - - - - - - - - - - - - - - - - "; - } - print "
- - - - - -
- - ".($i+1)." - -
-
- ".$this->Link($page["tag"])." - - - $page[time] - -
-   - - $matchText -
-   -
"; - } + $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","$1",$text,-1); + $matchText = "…".$highlightMatch."…"; + $output .= "\n

".($i+1)." ".$this->Link($page["tag"])." — ".$page[time]."

"; + $output .= "\n
".$matchText."
\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" => "*");