} else {
$languages = Language::getLanguageNames( $customisedOnly );
}
-
+
// Make sure the site language is in the list; a custom language code might not have a
// defined name...
if( !array_key_exists( $wgLanguageCode, $languages ) ) {
$languages[$wgLanguageCode] = $wgLanguageCode;
}
-
+
ksort( $languages );
/**
return $this->parameters;
}
+ /**
+ * @return User
+ */
public function getPerformer() {
return $this->performer;
}
* Implements Special:DeletedContributions to display archived revisions
* @ingroup SpecialPage
*/
-
class DeletedContribsPager extends IndexPager {
public $mDefaultDirection = true;
var $messages, $target;
$user = $this->getUser();
// Paranoia: avoid brute force searches (bug 17792)
if( !$user->isAllowed( 'deletedhistory' ) ) {
- $conds[] = $this->mDb->bitAnd('ar_deleted',Revision::DELETED_USER) . ' = 0';
+ $conds[] = $this->mDb->bitAnd( 'ar_deleted', Revision::DELETED_USER ) . ' = 0';
} elseif( !$user->isAllowed( 'suppressrevision' ) ) {
- $conds[] = $this->mDb->bitAnd('ar_deleted',Revision::SUPPRESSED_USER) .
+ $conds[] = $this->mDb->bitAnd( 'ar_deleted', Revision::SUPPRESSED_USER ) .
' != ' . Revision::SUPPRESSED_USER;
}
return array(
* written by the target user.
*
* @todo This would probably look a lot nicer in a table.
+ * @param $row
* @return string
*/
function formatRow( $row ) {
} else {
$user = Linker::link( $userObj->getUserPage(), htmlspecialchars( $userObj->getName() ) );
}
+ $links = '';
$nt = $userObj->getUserPage();
$id = $userObj->getID();
$talk = $nt->getTalkPage();
* Attempts to clean up broken items
*/
private function cleanupWatchlist() {
- if ( count( $this->badItems ) ) {
- $dbw = wfGetDB( DB_MASTER );
- }
+ $dbw = wfGetDB( DB_MASTER );
foreach ( $this->badItems as $row ) {
list( $title, $namespace, $dbKey ) = $row;
wfDebug( "User {$this->getUser()} has broken watchlist item ns($namespace):$dbKey, "
}
/**
- * @return false|string wgVersion + HEAD sha1 stripped to the first 7 chars
+ * @return bool|string wgVersion + HEAD sha1 stripped to the first 7 chars. False on failure
*/
private static function getVersionLinkedGit() {
global $wgVersion, $IP;
/**
* Callback to sort extensions by type.
+ * @param $a array
+ * @param $b array
* @return int
*/
function compare( $a, $b ) {
* url The subversion URL of the directory
* repo-url The base URL of the repository
* viewvc-url A ViewVC URL pointing to the checked-out revision
+ * @param $dir string
* @return array|bool
*/
public static function getSvnInfo( $dir ) {
/**
* @param $dir String: directory of the git checkout
- * @return false|String sha1 of commit HEAD points to
+ * @return bool|String sha1 of commit HEAD points to
*/
public static function getGitHeadSha1( $dir ) {
$BASEDIR = "{$dir}/.git/";
}
preg_match( "/ref: (.*)/",
- file_get_contents( $HEADfile), $m );
+ file_get_contents( $HEADfile), $m );
$REFfile = "{$BASEDIR}{$m[1]}";
if( !file_exists( $REFfile ) ) {
return false;
}
- $sha1 = chop(file_get_contents( $REFfile ));
+ $sha1 = rtrim( file_get_contents( $REFfile ) );
return $sha1;
}
-
function showEasterEgg() {
$rx = $rp = $xe = '';
$alpha = array("", "kbQW", "\$\n()");