ignore VisualEditor

master
落雨楓 3 years ago
parent d2dfc9d6b5
commit 6ea1671ec4

1
.gitignore vendored

@ -1,3 +1,2 @@
LatinizeUrl.zip LatinizeUrl.zip
includes/._Utils.php

@ -46,6 +46,8 @@ class Hooks {
$request->setVal('title', $title->getPrefixedDBkey()); $request->setVal('title', $title->getPrefixedDBkey());
} elseif($wgLatinizeUrlForceRedirect } elseif($wgLatinizeUrlForceRedirect
&& !($request->getVal('action') && $request->getVal('action') != 'view') && !($request->getVal('action') && $request->getVal('action') != 'view')
&& !$request->getVal('veaction')
&& !defined('MW_API')
&& in_array($title->getNamespace(), self::$allowedNS)) { //把原标题页面重定向到拼音页面 && in_array($title->getNamespace(), self::$allowedNS)) { //把原标题页面重定向到拼音页面
$slug = Utils::getSlugUrlByTitle($title); $slug = Utils::getSlugUrlByTitle($title);
if($slug) $title = Title::newFromText($slug, $title->getNamespace()); if($slug) $title = Title::newFromText($slug, $title->getNamespace());

@ -97,7 +97,7 @@ class Utils {
], __METHOD__, [ ], __METHOD__, [
'LIMIT' => 1, 'LIMIT' => 1,
]); ]);
if($res->numRows() > 0){ if ($res->numRows() > 0) {
$data = $res->fetchRow(); $data = $res->fetchRow();
return $data['title']; return $data['title'];
} else { } else {
@ -300,7 +300,7 @@ class Utils {
'title' => $title, 'title' => $title,
], __METHOD__); ], __METHOD__);
self::$dbr->delete('url_slug', [ self::$dbw->delete('url_slug', [
'title' => $title, 'title' => $title,
]); ]);

@ -127,7 +127,6 @@ class SpecialCustomUrl extends FormSpecialPage
$originSubpaeSlug = Utils::getSlugByTitle($subpage); $originSubpaeSlug = Utils::getSlugByTitle($subpage);
if(strpos($originSubpaeSlug, $originSlug) === 0){ if(strpos($originSubpaeSlug, $originSlug) === 0){
$newSubpageSlug = $realSlug . substr($originSubpaeSlug, $originSlugLen); $newSubpageSlug = $realSlug . substr($originSubpaeSlug, $originSlugLen);
var_dump($newSubpageSlug);
Utils::updateTitleSlugMap($subpage->getText(), $newSubpageSlug, [$newSubpageSlug], 1); Utils::updateTitleSlugMap($subpage->getText(), $newSubpageSlug, [$newSubpageSlug], 1);
} }
} }

Loading…
Cancel
Save