/** @var string Interwiki prefix */
public $mInterwiki = '';
+ /** @var bool Was this Title created from a string with a local interwiki prefix? */
+ private $mLocalInterwiki = false;
+
/** @var string Title fragment (i.e. the bit after the #) */
public $mFragment = '';
return $this->mInterwiki;
}
+ /**
+ * Was this a local interwiki link?
+ *
+ * @return bool
+ */
+ public function wasLocalInterwiki() {
+ return $this->mLocalInterwiki;
+ }
+
/**
* Determine whether the object refers to a page within
* this project and is transcludable.
* $wgServer is prepended to make an absolute URL.
*
* @see self::getFullURL to always get an absolute URL.
+ * @see self::getLinkURL to always get a URL that's the simplest URL that will be
+ * valid to link, locally, to the current Title.
* @see self::newFromText to produce a Title object.
*
* @param string|array $query An optional query string,
$errors[] = array( 'immobile-target-page' );
}
} elseif ( $action == 'delete' ) {
+ if ( count( $this->getUserPermissionsErrorsInternal( 'edit',
+ $user, $doExpensiveQueries, true ) )
+ ) {
+ // If they can't edit, they shouldn't delete.
+ $errors[] = array( 'delete-cantedit' );
+ }
if ( $doExpensiveQueries && $wgDeleteRevisionsLimit
&& !$this->userCan( 'bigdelete', $user ) && $this->isBigDeletion()
) {
# Fill fields
$this->setFragment( '#' . $parts['fragment'] );
$this->mInterwiki = $parts['interwiki'];
+ $this->mLocalInterwiki = $parts['local_interwiki'];
$this->mNamespace = $parts['namespace'];
$this->mUserCaseDBKey = $parts['user_case_dbkey'];