summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMacil Tech <maciltech@gmail.com>2012-11-02 22:29:11 -0600
committerMacil Tech <maciltech@gmail.com>2013-01-19 00:39:30 -0600
commit7eef94e04e3f80ae776cd2c02ca29dd93945a47f (patch)
tree9ed287c0fe2ab5fc00d7909c8d678ac7d3d5b63a
parent90ada24ddc84c08ddeb2411e0ede02b1afa7104c (diff)
Fix transforming links to mod links in OP posts.
Similar regexes are called for threads and posts, but they differed needlessly, and the thread regex would drop anything between the `<a` and `href="` parts. This makes them both the same and functional.
-rw-r--r--inc/display.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/display.php b/inc/display.php
index ef952ca2..2b5d3116 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -350,8 +350,8 @@ class Thread {
// Fix internal links
// Very complicated regex
$this->body = preg_replace(
- '/<a(([a-zA-Z]+="[^"]+")|[a-zA-Z]+=[a-zA-Z]+|\s)*href="' . preg_quote($config['root'], '/') . '(' . sprintf(preg_quote($config['board_path'], '/'), '\w+') . ')/',
- '<a href="?/$3',
+ '/<a((([a-zA-Z]+="[^"]+")|[a-zA-Z]+=[a-zA-Z]+|\s)*)href="' . preg_quote($config['root'], '/') . '(' . sprintf(preg_quote($config['board_path'], '/'), '\w+') . ')/',
+ '<a $1href="?/$4',
$this->body
);
}