forked from GithubBackups/vichan
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.
This commit is contained in:
parent
90ada24ddc
commit
7eef94e04e
@ -350,8 +350,8 @@ class Thread {
|
|||||||
// Fix internal links
|
// Fix internal links
|
||||||
// Very complicated regex
|
// Very complicated regex
|
||||||
$this->body = preg_replace(
|
$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((([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 $1href="?/$4',
|
||||||
$this->body
|
$this->body
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user