]> git.mjollnir.org Git - s9y.git/commitdiff
possible xss for shoutbox/templatedropdown,
authorgarvinhicking <garvinhicking>
Mon, 9 May 2005 13:03:20 +0000 (13:03 +0000)
committergarvinhicking <garvinhicking>
Mon, 9 May 2005 13:03:20 +0000 (13:03 +0000)
fix author pagination

docs/NEWS
include/functions.inc.php
index.php

index 7c530a5920d449cfb041a1764431e8b29a4cb332..5691784d22b79612d6105c1261f4c41b241e4380 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,11 @@
 Version 0.9 ()
 ------------------------------------------------------------------------
 
+    * Fix possible XSS when using the templatedropdown or shoutbox
+      plugins (garvinhicking)
+
+    * Fix pagination of "Entries by Author" (garvinhicking)
+
     * Fix RSS 1.0 missing top-level namespace (garvinhicking)
     
     * Added new event hook to the trackback sending facility so that
index 5bf13d7242bbc19ad326f7a3117bc14ae84e63b3..b154344209edeba51bd329e25b7c01997dfd5366 100644 (file)
@@ -657,7 +657,7 @@ function serendipity_currentURL() {
     $url = $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?' . $uri['path'] . $qst;
     $url = str_replace($serendipity['indexFile'] . '&amp;', '', $url); // Kill possible looped repitions which could occur
 
-    return $url;
+    return strip_tags($url);
 }
 
 function serendipity_getUriArguments($uri, $wildcard = false) {
index a38b2764bc0d572a42a638b12545c83b02055e2b..6b130e190b54f4ca4c88506bc00357653671c14f 100644 (file)
--- a/index.php
+++ b/index.php
@@ -250,6 +250,20 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
 
     include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
 } else if (preg_match(PAT_AUTHORS, $uri, $matches)) {
+    $_args = $serendipity['uriArguments'];
+
+    /* Attempt to locate hidden variables within the URI */
+    foreach ($_args as $k => $v){
+        if ($v == PATH_AUTHORS) {
+            continue;
+        }
+        if ($v{0} == 'P') { /* Page */
+            $serendipity['GET']['page'] = substr($v, 1);
+            unset($_args[$k]);
+            unset($serendipity['uriArguments'][$k]);
+        }
+    }
+
     $serendipity['GET']['viewAuthor'] = $matches[1];
     $serendipity['GET']['action'] = 'read';