Created
December 3, 2009 08:49
-
-
Save sotarok/247998 to your computer and use it in GitHub Desktop.
dekiwiki (mindtouch) for PHP 5.3 patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/deki/plugins/special_page/special_page.php b/deki/plugins/special_page/special_page.php | |
index 209ab0e..407ace0 100644 | |
--- a/deki/plugins/special_page/special_page.php | |
+++ b/deki/plugins/special_page/special_page.php | |
@@ -141,7 +141,7 @@ abstract class SpecialPagePlugin extends DekiPlugin | |
else if ($returnToTitle) | |
{ | |
$Title = Title::newFromText($returnToTitle); | |
- // fix direct comparisons to 'Special', use Namespace::getSpecial() etc | |
+ // fix direct comparisons to 'Special', use Namespaces::getSpecial() etc | |
if ($Title->getPrefixedText() == 'Special:Userlogin' || $Title->getPrefixedText() == 'Special:Userlogout') | |
{ | |
$Title = Title::newFromText(''); | |
@@ -263,7 +263,7 @@ abstract class SpecialPagePlugin extends DekiPlugin | |
*/ | |
public function getTitle() | |
{ | |
- return Title::newFromText($this->pageName, Namespace::getSpecial()); | |
+ return Title::newFromText($this->pageName, Namespaces::getSpecial()); | |
} | |
//abstract public function output(); | |
diff --git a/deki/plugins/special_page/special_pagealerts/special_pagealerts.php b/deki/plugins/special_page/special_pagealerts/special_pagealerts.php | |
index c9b900b..02cede7 100644 | |
--- a/deki/plugins/special_page/special_pagealerts/special_pagealerts.php | |
+++ b/deki/plugins/special_page/special_pagealerts/special_pagealerts.php | |
@@ -65,7 +65,7 @@ class SpecialPageAlerts extends SpecialPagePlugin | |
// notify the user that they must be logged in first | |
DekiMessage::error(wfMsg('Page.PageAlerts.error.anonymous')); | |
- $UserLogin = Title::newFromText('UserLogin', Namespace::getSpecial()); | |
+ $UserLogin = Title::newFromText('UserLogin', Namespaces::getSpecial()); | |
self::redirectTo($UserLogin, $Title); | |
return; | |
} | |
diff --git a/deki/plugins/special_page/special_search/lucene_search.php b/deki/plugins/special_page/special_search/lucene_search.php | |
index ebdcf86..6c6a9d5 100644 | |
--- a/deki/plugins/special_page/special_search/lucene_search.php | |
+++ b/deki/plugins/special_page/special_search/lucene_search.php | |
@@ -283,7 +283,7 @@ class LuceneSearch extends SpecialPagePlugin | |
. wfMsg('Page.Search.found-in', $sk->makeKnownLinkObj($path, $path->getDisplayText())) | |
.'</span>'; | |
} | |
- $class = 'deki-ns'.strtolower(Namespace::getCanonicalName(NS_FILE)); | |
+ $class = 'deki-ns'.strtolower(Namespaces::getCanonicalName(NS_FILE)); | |
} | |
else | |
{ | |
@@ -301,7 +301,7 @@ class LuceneSearch extends SpecialPagePlugin | |
. wfMsg('Page.Search.found-in', $sk->makeKnownLinkObj($parent, $parent->getDisplayText())) | |
. '</span>'; | |
} | |
- $class = 'deki-ns'.strtolower(Namespace::getCanonicalName($nt->getNamespace())); | |
+ $class = 'deki-ns'.strtolower(Namespaces::getCanonicalName($nt->getNamespace())); | |
} | |
} | |
else | |
diff --git a/deki/plugins/special_page/special_userlogin/special_userlogin.php b/deki/plugins/special_page/special_userlogin/special_userlogin.php | |
index c3d1fb3..e8dc5e6 100644 | |
--- a/deki/plugins/special_page/special_userlogin/special_userlogin.php | |
+++ b/deki/plugins/special_page/special_userlogin/special_userlogin.php | |
@@ -54,7 +54,7 @@ class SpecialUserLogin extends SpecialPagePlugin | |
$register = $Request->getBool('register', false); | |
if ($register) | |
{ | |
- $Title = Title::newFromText('UserRegistration', Namespace::getSpecial()); | |
+ $Title = Title::newFromText('UserRegistration', Namespaces::getSpecial()); | |
self::redirectTo($Title); | |
return; | |
} | |
@@ -105,7 +105,7 @@ class SpecialUserLogin extends SpecialPagePlugin | |
$Lookup = DekiUser::newFromText($username); | |
if (!is_null($Lookup)) | |
{ | |
- $Title = Title::newFromText('UserPassword', Namespace::getSpecial()); | |
+ $Title = Title::newFromText('UserPassword', Namespaces::getSpecial()); | |
DekiMessage::error(wfMsg('Page.UserLogin.error.password', $Title->getLocalURL())); | |
} | |
else | |
@@ -117,7 +117,7 @@ class SpecialUserLogin extends SpecialPagePlugin | |
if ($Current->canCreateAccount()) | |
{ | |
$query = 'username='.urlencode($username); | |
- $Title = Title::newFromText('UserRegistration', Namespace::getSpecial()); | |
+ $Title = Title::newFromText('UserRegistration', Namespaces::getSpecial()); | |
DekiMessage::error(wfMsg('Page.UserLogin.error.user', $Title->getLocalUrl($query))); | |
} | |
else | |
diff --git a/deki/plugins/special_page/special_userpassword/special_userpassword.php b/deki/plugins/special_page/special_userpassword/special_userpassword.php | |
index c4fc6f5..cad32c3 100644 | |
--- a/deki/plugins/special_page/special_userpassword/special_userpassword.php | |
+++ b/deki/plugins/special_page/special_userpassword/special_userpassword.php | |
@@ -48,7 +48,7 @@ class SpecialUserPassword extends SpecialPagePlugin | |
$User = DekiUser::getCurrent(); | |
if (!$User->isAnonymous()) | |
{ | |
- $Title = Title::newFromText('UserLogin', Namespace::getSpecial()); | |
+ $Title = Title::newFromText('UserLogin', Namespaces::getSpecial()); | |
self::redirect($Title->getLocalUrl()); | |
return; | |
} | |
diff --git a/includes/Article.php b/includes/Article.php | |
index 2621c08..fbea1ae 100644 | |
--- a/includes/Article.php | |
+++ b/includes/Article.php | |
@@ -116,7 +116,7 @@ class Article { | |
function isViewPage() { | |
global $wgRequest; | |
- return !Namespace::isTalk($this->getTitle()->getNamespace()) && ($wgRequest->getVal('action') == '' || $wgRequest->getVal('action') == 'view') | |
+ return !Namespaces::isTalk($this->getTitle()->getNamespace()) && ($wgRequest->getVal('action') == '' || $wgRequest->getVal('action') == 'view') | |
&& (!$wgRequest->getVal('revision') && !$wgRequest->getVal('oldid') && !$wgRequest->getVal('diff') && $this->getTitle()->canEditNamespace()); | |
} | |
@@ -502,7 +502,7 @@ class Article { | |
while (!is_null($parents)) | |
{ | |
$nt = Title::newFromText(isset($parents['path']) ? $parents['path']: ''); | |
- $paths[] = '<a href="'.$nt->getFullUrl().'" class="deki-ns'.strtolower(Namespace::getCanonicalName($nt->getNamespace())).'">' | |
+ $paths[] = '<a href="'.$nt->getFullUrl().'" class="deki-ns'.strtolower(Namespaces::getCanonicalName($nt->getNamespace())).'">' | |
.htmlspecialchars($parents['title']) | |
.'</a>'; | |
$parents = isset($parents['page.parent']) ? $parents['page.parent']: null; | |
@@ -566,7 +566,7 @@ class Article { | |
return false; | |
} | |
global $wgTitle; | |
- $ntt = Title::newFromText($wgTitle->getText(), Namespace::getTalk($wgTitle->getNamespace())); | |
+ $ntt = Title::newFromText($wgTitle->getText(), Namespaces::getTalk($wgTitle->getNamespace())); | |
if (strcmp($wgTitle->getPrefixedText(), $ntt->getPrefixedText()) == 0) | |
{ | |
return false; | |
@@ -643,7 +643,7 @@ class Article { | |
{ | |
return false; | |
} | |
- if (Namespace::isTalk($this->getTitle()->getNamespace())) | |
+ if (Namespaces::isTalk($this->getTitle()->getNamespace())) | |
{ | |
return false; | |
} | |
@@ -680,7 +680,7 @@ class Article { | |
|| !$this->getTitle()->isEditable()) { | |
return false; | |
} | |
- if (Namespace::isTalk($this->getTitle()->getNamespace())) | |
+ if (Namespaces::isTalk($this->getTitle()->getNamespace())) | |
{ | |
return false; | |
} | |
@@ -1513,9 +1513,9 @@ class Article { | |
$ns = $this->getTitle()->getNamespace(); | |
if (NS_TEMPLATE == $ns) { | |
- $redirectTitle = Title::newFromText(Namespace::getCanonicalName(NS_TEMPLATE).':'); | |
+ $redirectTitle = Title::newFromText(Namespaces::getCanonicalName(NS_TEMPLATE).':'); | |
} | |
- elseif (Namespace::isTalk($ns)) { | |
+ elseif (Namespaces::isTalk($ns)) { | |
switch ($ns) | |
{ | |
case NS_USER_TALK: | |
diff --git a/includes/EditPage.php b/includes/EditPage.php | |
index 576491b..0862ef1 100644 | |
--- a/includes/EditPage.php | |
+++ b/includes/EditPage.php | |
@@ -363,7 +363,7 @@ class EditPage { | |
global $wgDekiPlug; | |
if ($wgRequest->getVal('template')) | |
{ | |
- $tpTitle = Title::newFromURL( Namespace::getCanonicalName(NS_TEMPLATE).':'.$wgRequest->getVal('template') ); | |
+ $tpTitle = Title::newFromURL( Namespaces::getCanonicalName(NS_TEMPLATE).':'.$wgRequest->getVal('template') ); | |
$r = $wgDekiPlug->At('pages', '='.urlencode(urlencode($tpTitle->getPrefixedDBkey())), 'contents')->With('mode', 'edit')->With('include', 'true'); | |
$params = Article::getParameters(); | |
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php | |
index d6b75a0..7740e3c 100644 | |
--- a/includes/GlobalFunctions.php | |
+++ b/includes/GlobalFunctions.php | |
@@ -1159,7 +1159,7 @@ function wfShowTree($id, $ns, $tree, $sk) { | |
switch ($ns) { | |
case NS_TEMPLATE: | |
case NS_USER: | |
- $pageTitle = '='.urlencode(urlencode(Namespace::getCanonicalName($ns).':')); | |
+ $pageTitle = '='.urlencode(urlencode(Namespaces::getCanonicalName($ns).':')); | |
$r = $wgDekiPlug->At('pages', $pageTitle, 'tree')->With('format', 'html')->With('startpage', 'false')->Get(); | |
break; | |
default: | |
@@ -1167,7 +1167,7 @@ function wfShowTree($id, $ns, $tree, $sk) { | |
break; | |
} | |
if (!MTMessage::HandleFromDream($r) || empty($r['body'])) { | |
- switch (Namespace::getCanonicalName($ns)) | |
+ switch (Namespaces::getCanonicalName($ns)) | |
{ | |
case 'Template': | |
return wfMsg('Page.ListTemplates.page-has-no-text'); | |
@@ -1189,11 +1189,11 @@ function wfShowNSTree($ns, $addTitle = false) { | |
$wgOut->addHTML('<p><strong><a href="'.$sk->makeUrl(wfHomePageInternalTitle()).'">'.$wgSitename.'</a></strong></p>'); | |
break; | |
case NS_TEMPLATE: | |
- $nt = Title::newFromText(Namespace::getCanonicalName(NS_TEMPLATE).':'); | |
+ $nt = Title::newFromText(Namespaces::getCanonicalName(NS_TEMPLATE).':'); | |
$wgOut->addHTML('<p><strong><a href="'.$nt->getLocalURL().'">'.$addTitle.'</a></strong></p>'); | |
break; | |
case NS_USER: | |
- $nt = Title::newFromText(Namespace::getCanonicalName(NS_USER).':'); | |
+ $nt = Title::newFromText(Namespaces::getCanonicalName(NS_USER).':'); | |
$wgOut->addHTML('<p><strong><a href="'.$nt->getLocalURL().'">'.$addTitle.'</a></strong></p>'); | |
break; | |
} | |
diff --git a/includes/Namespace.php b/includes/Namespace.php | |
index 6965580..a15fa14 100644 | |
--- a/includes/Namespace.php | |
+++ b/includes/Namespace.php | |
@@ -73,7 +73,7 @@ $wgCanonicalNamespaceNames = array( | |
* | |
* @package MediaWiki | |
*/ | |
-class Namespace { | |
+class Namespaces { | |
/**#@+ | |
* These functions are deprecated | |
@@ -117,7 +117,7 @@ class Namespace { | |
* Get the talk namespace corresponding to the given index | |
*/ | |
function getTalk( $index ) { | |
- if ( Namespace::isTalk( $index ) ) { | |
+ if ( Namespaces::isTalk( $index ) ) { | |
return $index; | |
} else { | |
# FIXME | |
@@ -126,7 +126,7 @@ class Namespace { | |
} | |
function getSubject( $index ) { | |
- if ( Namespace::isTalk( $index ) ) { | |
+ if ( Namespaces::isTalk( $index ) ) { | |
return $index - 1; | |
} else { | |
return $index; | |
diff --git a/includes/Skin.php b/includes/Skin.php | |
index ef2da1d..57c5f75 100644 | |
--- a/includes/Skin.php | |
+++ b/includes/Skin.php | |
@@ -134,7 +134,7 @@ class Skin { | |
//special case: for articles, append the current page as unlinked text | |
if (isset($wgArticle->mTitleText) && !is_null($wgArticle->mTitleText)) { | |
- $parents[] = '<a href="'.$wgTitle->getFullUrl().'" class="deki-ns'.strtolower(Namespace::getCanonicalName($wgTitle->getNamespace())).' current">'.htmlspecialchars($wgArticle->mTitleText).'</a>'; | |
+ $parents[] = '<a href="'.$wgTitle->getFullUrl().'" class="deki-ns'.strtolower(Namespaces::getCanonicalName($wgTitle->getNamespace())).' current">'.htmlspecialchars($wgArticle->mTitleText).'</a>'; | |
} | |
return $parents; | |
} | |
@@ -606,7 +606,7 @@ class Skin { | |
$timestamp = $wgArticle->getTimestamp(); | |
$formattedts = $this->lastModifiedHumanReadable(); | |
$historylink = $wgArticle->getTitle()->getLocalUrl('action=history'); | |
- $userlink = $wgUser->getSkin()->makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ':' . $wgArticle->getUserText(), $wgArticle->getUserText() ); | |
+ $userlink = $wgUser->getSkin()->makeLink( $wgContLang->getNsText( Namespaces::getUser() ) . ':' . $wgArticle->getUserText(), $wgArticle->getUserText() ); | |
return wfMsg('Skin.Common.page-last-modified-full', sprintf('<a href="%s" title="%s">%s</a>', $historylink, $formattedts, $formattedts), $userlink); | |
} | |
@@ -1109,7 +1109,7 @@ class Skin { | |
# format regular and media links - all other wiki formatting | |
# is ignored | |
- $medians = $wgContLang->getNsText(Namespace::getMedia()).':'; | |
+ $medians = $wgContLang->getNsText(Namespaces::getMedia()).':'; | |
while(preg_match('/\[\[(.*?)(\|(.*?))*\]\](.*)$/',$comment,$match)) { | |
# Handle link renaming [[foo|text]] will show link as "text" | |
if( "" != $match[3] ) { | |
@@ -1581,7 +1581,7 @@ class Skin { | |
*/ | |
public static function getPageAlertsButton($Article, $enabled = true) | |
{ | |
- $Title = Title::newFromText('PageAlerts', Namespace::getSpecial()); | |
+ $Title = Title::newFromText('PageAlerts', Namespaces::getSpecial()); | |
$specialUrl = $Title->getLocalURL('id=' . $Article->getId()); | |
if (!$enabled) | |
diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php | |
index 1c4d656..1e4b0a1 100644 | |
--- a/includes/SkinTemplate.php | |
+++ b/includes/SkinTemplate.php | |
@@ -170,8 +170,8 @@ class SkinTemplate extends Skin { | |
$tpl =& $this->setupTemplate( $this->template, 'skins' ); | |
$tpl->setTranslator(new MediaWiki_I18N()); | |
- $this->iseditable = ($wgTitle->getNamespace() != Namespace::getSpecial() ) && !($action == 'edit' || $action == 'submit'); | |
- $this->userpage = $wgContLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName(); | |
+ $this->iseditable = ($wgTitle->getNamespace() != Namespaces::getSpecial() ) && !($action == 'edit' || $action == 'submit'); | |
+ $this->userpage = $wgContLang->getNsText( Namespaces::getUser() ) . ":" . $wgUser->getName(); | |
$this->userpageUrlDetails = $this->makeUrlDetails($this->userpage); | |
# If user is logged in | |
@@ -330,7 +330,7 @@ class SkinTemplate extends Skin { | |
if (0 != $wgArticle->getID() ) { | |
$tpl->set('lastmodhuman', $this->lastModifiedHumanReadable()); | |
if ($wgArticle->getUser()) { | |
- $tpl->set('lastmodby', $sk->makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ':' . $wgArticle->getUserText(), $wgArticle->getUserText() )); | |
+ $tpl->set('lastmodby', $sk->makeLink( $wgContLang->getNsText( Namespaces::getUser() ) . ':' . $wgArticle->getUserText(), $wgArticle->getUserText() )); | |
} | |
} | |
else { | |
@@ -444,7 +444,7 @@ class SkinTemplate extends Skin { | |
{ | |
$this->cssclass->pagerestrict = ''; | |
$this->onclick->pagerestrict = ''; | |
- $st = Title::newFromText('PageRestrictions', Namespace::getSpecial()); | |
+ $st = Title::newFromText('PageRestrictions', Namespaces::getSpecial()); | |
$this->href->pagerestrict = $st->getLocalUrl('id='.$wgArticle->getId()); | |
} | |
else | |
@@ -482,7 +482,7 @@ class SkinTemplate extends Skin { | |
} | |
//main page link | |
- $mt = Title::newFromText($wgTitle->getText(), Namespace::getSubject($wgTitle->getNamespace())); | |
+ $mt = Title::newFromText($wgTitle->getText(), Namespaces::getSubject($wgTitle->getNamespace())); | |
$this->href->pagemain = $mt->getLocalUrl(); | |
if ($wgArticle->isViewPage()) { | |
$this->cssclass->pagemain = 'active'; | |
@@ -510,7 +510,7 @@ class SkinTemplate extends Skin { | |
} | |
//talk link | |
- $ntt = Title::newFromText($wgTitle->getText(), Namespace::getTalk($wgTitle->getNamespace())); | |
+ $ntt = Title::newFromText($wgTitle->getText(), Namespaces::getTalk($wgTitle->getNamespace())); | |
$this->href->pagetalk = !$wgArticle->userCanTalk() ? '#': $ntt->getLocalUrl(); | |
if (!$wgArticle->userCanTalk()) | |
{ | |
@@ -518,7 +518,7 @@ class SkinTemplate extends Skin { | |
} | |
else | |
{ | |
- $this->cssclass->pagetalk = Namespace::isTalk($wgTitle->getNamespace()) ? 'active': 'inactive'; | |
+ $this->cssclass->pagetalk = Namespaces::isTalk($wgTitle->getNamespace()) ? 'active': 'inactive'; | |
} | |
//custom buttons to match mediawiki output | |
diff --git a/includes/SkinTemplate_.php b/includes/SkinTemplate_.php | |
index c73ec5d..44b75be 100644 | |
--- a/includes/SkinTemplate_.php | |
+++ b/includes/SkinTemplate_.php | |
@@ -264,7 +264,7 @@ class SkinTemplate extends Skin { | |
if (0 != $wgArticle->getID() ) { | |
$tpl->set('lastmodhuman', $this->lastModifiedHumanReadable()); | |
if ($wgArticle->getUser()) { | |
- $tpl->set('lastmodby', $sk->makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ':' . $wgArticle->getUserText(), $wgArticle->getUserText() )); | |
+ $tpl->set('lastmodby', $sk->makeLink( $wgContLang->getNsText( Namespaces::getUser() ) . ':' . $wgArticle->getUserText(), $wgArticle->getUserText() )); | |
} | |
} | |
$tpl->set('pagemodified', $lastmod); | |
@@ -496,7 +496,7 @@ class SkinTemplate extends Skin { | |
{ | |
//$this->cssclass->pagerestrict = ''; | |
//$this->onclick->pagerestrict = ''; | |
- $st = Title::newFromText('PageRestrictions', Namespace::getSpecial()); | |
+ $st = Title::newFromText('PageRestrictions', Namespaces::getSpecial()); | |
$this->href->pagerestrict = $st->getLocalUrl('id='.$wgArticle->getId()); | |
} | |
else { | |
@@ -574,7 +574,7 @@ class SkinTemplate extends Skin { | |
} | |
//talk link | |
- $ntt = Title::newFromText($wgTitle->getText(), Namespace::getTalk($wgTitle->getNamespace())); | |
+ $ntt = Title::newFromText($wgTitle->getText(), Namespaces::getTalk($wgTitle->getNamespace())); | |
$this->href->pagetalk = !$wgArticle->userCanTalk() ? '#': $ntt->getLocalUrl(); | |
if (!$wgArticle->userCanTalk()) | |
{ | |
@@ -582,7 +582,7 @@ class SkinTemplate extends Skin { | |
} | |
else | |
{ | |
- $this->cssclass->pagetalk = Namespace::isTalk($wgTitle->getNamespace()) ? 'active': 'inactive'; | |
+ $this->cssclass->pagetalk = Namespaces::isTalk($wgTitle->getNamespace()) ? 'active': 'inactive'; | |
} | |
// page alerts: views pages, talk pages, and logged in users with subscribe | |
diff --git a/includes/Title.php b/includes/Title.php | |
index cb659f6..ae67921 100644 | |
--- a/includes/Title.php | |
+++ b/includes/Title.php | |
@@ -416,7 +416,7 @@ class Title { | |
} | |
function getPrefix() { | |
- return Namespace::getCanonicalName($this->getNamespace()).':'; | |
+ return Namespaces::getCanonicalName($this->getNamespace()).':'; | |
} | |
/*** | |
@@ -794,7 +794,7 @@ class Title { | |
function isTalkPage() { | |
//there are many different talk namespaces; Talk:, User_Talk:, etc. | |
- return Namespace::isTalk($this->getNamespace()); | |
+ return Namespaces::isTalk($this->getNamespace()); | |
} | |
public function isTemplateHomepage() | |
@@ -930,7 +930,7 @@ class Title { | |
if ( preg_match( "/^(.+?)_*:_*(.*)$/S", $t, $m ) ) { | |
$p = $m[1]; | |
$lowerNs = strtolower( $p ); | |
- if ( $ns = Namespace::getCanonicalIndex( $lowerNs ) ) { | |
+ if ( $ns = Namespaces::getCanonicalIndex( $lowerNs ) ) { | |
# Canonical namespace | |
$t = $m[2]; | |
$this->mNamespace = $ns; | |
diff --git a/includes/libraries/dom.php b/includes/libraries/dom.php | |
index 9b3e3ac..b41b6c5 100644 | |
--- a/includes/libraries/dom.php | |
+++ b/includes/libraries/dom.php | |
@@ -362,4 +362,3 @@ class DomSortTable extends DomTable | |
} | |
} | |
-?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment