diff options
| author | Macil Tech <maciltech@gmail.com> | 2012-11-02 22:29:11 -0600 |
|---|---|---|
| committer | Macil Tech <maciltech@gmail.com> | 2013-01-19 00:39:30 -0600 |
| commit | 7eef94e04e3f80ae776cd2c02ca29dd93945a47f (patch) | |
| tree | 9ed287c0fe2ab5fc00d7909c8d678ac7d3d5b63a /inc/display.php | |
| parent | 90ada24ddc84c08ddeb2411e0ede02b1afa7104c (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.
Diffstat (limited to 'inc/display.php')
| -rw-r--r-- | inc/display.php | 4 |
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 ); } |
