summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/common.inc20
1 files changed, 20 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index e67843333..0d828b73d 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -471,8 +471,28 @@ function filter($text) {
return $text;
}
+function rewrite_old_urls($text) {
+
+ /*
+ ** This is a *temporary* filter to rewrite old-style URLs to new-style
+ ** URLs (clean URLs). Currently, URLs are being rewritten dynamically
+ ** (ie. "on output"), however When these rewrite rules have been tested
+ ** enough, we will use them to permanently rewrite the links in node
+ ** and comment bodies.
+ */
+
+ // rewrite 'node.php?id=<number>[&cid=<number>]'
+ $text = eregi_replace("(node)\.php\?id=([[:digit:]]+)(&cid=)?([[:digit:]]*)", "?q=\\1/view/\\2/\\4", $text);
+
+ return $text;
+}
+
function check_output($text) {
if (isset($text)) {
+
+ // temporary: for development purpose
+ $text = rewrite_old_urls($text);
+
$text = stripslashes($text);
if (strip_tags($text, "<a><i><b><u><tt><code><cite><strong><img>") == $text) {