mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 09:49:31 +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
|
- Daniel Kraus (@bovender), main developer
|
||||||
- Ulrich Strauss (@c0nnex), namespaces
|
- Ulrich Strauss (@c0nnex), namespaces
|
||||||
- Brent Laabs (@labster), code review and bug fixes
|
- Brent Laabs (@labster), code review and bug fixes
|
||||||
|
- @tetsuya-zama, bug fix
|
||||||
|
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
"author": [
|
"author": [
|
||||||
"[https://www.mediawiki.org/wiki/User:Bovender Daniel Kraus (bovender)]",
|
"[https://www.mediawiki.org/wiki/User:Bovender Daniel Kraus (bovender)]",
|
||||||
"Ulrich Strauss (c0nnex)",
|
"Ulrich Strauss (c0nnex)",
|
||||||
"Brent Laabs (labster)"
|
"Brent Laabs (labster)",
|
||||||
|
"tetsuya-zama"
|
||||||
],
|
],
|
||||||
"type": "parserhook",
|
"type": "parserhook",
|
||||||
"url": "https://www.mediawiki.org/wiki/Extension:LinkTitles",
|
"url": "https://www.mediawiki.org/wiki/Extension:LinkTitles",
|
||||||
|
@ -139,7 +139,7 @@ class Target {
|
|||||||
public function getCaseSensitiveLinkValueRegex() {
|
public function getCaseSensitiveLinkValueRegex() {
|
||||||
if ( $this->caseSensitiveLinkValueRegex === null ) {
|
if ( $this->caseSensitiveLinkValueRegex === null ) {
|
||||||
$regexSafeTitle = $this->getRegexSafeTitle();
|
$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) . ')';
|
$this->caseSensitiveLinkValueRegex = '((?i)' . $regexSafeTitle[0] . '(?-i)' . substr($regexSafeTitle, 1) . ')';
|
||||||
} else {
|
} else {
|
||||||
$this->caseSensitiveLinkValueRegex = '(' . $regexSafeTitle . ')';
|
$this->caseSensitiveLinkValueRegex = '(' . $regexSafeTitle . ')';
|
||||||
|
Reference in New Issue
Block a user