mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 01:39:30 +02:00
Fix bug with non-latin languages.
- Fix: When $wgCapitalLinks was true, the extension would not work with non-latin languages. Closes #7.
This commit is contained in:
@ -31,6 +31,7 @@ Contributors
|
||||
- Daniel Kraus (@bovender), main developer
|
||||
- Ulrich Strauss (@c0nnex), namespaces
|
||||
- Brent Laabs (@labster), code review and bug fixes
|
||||
- @tetsuya-zama, bug fix
|
||||
|
||||
|
||||
Testing
|
||||
|
@ -3,7 +3,8 @@
|
||||
"author": [
|
||||
"[https://www.mediawiki.org/wiki/User:Bovender Daniel Kraus (bovender)]",
|
||||
"Ulrich Strauss (c0nnex)",
|
||||
"Brent Laabs (labster)"
|
||||
"Brent Laabs (labster)",
|
||||
"tetsuya-zama"
|
||||
],
|
||||
"type": "parserhook",
|
||||
"url": "https://www.mediawiki.org/wiki/Extension:LinkTitles",
|
||||
|
@ -139,7 +139,7 @@ class Target {
|
||||
public function getCaseSensitiveLinkValueRegex() {
|
||||
if ( $this->caseSensitiveLinkValueRegex === null ) {
|
||||
$regexSafeTitle = $this->getRegexSafeTitle();
|
||||
if ( $this->config->capitalLinks && ( $regexSafeTitle[0] != '\\' )) {
|
||||
if ( $this->config->capitalLinks && preg_match( '/[a-zA-Z]/', $regexSafeTitle[0] ) ) {
|
||||
$this->caseSensitiveLinkValueRegex = '((?i)' . $regexSafeTitle[0] . '(?-i)' . substr($regexSafeTitle, 1) . ')';
|
||||
} else {
|
||||
$this->caseSensitiveLinkValueRegex = '(' . $regexSafeTitle . ')';
|
||||
|
Reference in New Issue
Block a user