mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-19 20:23:17 +01:00
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
87b1498d23
commit
3b739ba722
@ -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
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user