<?php
/**
- * Representation a title within %MediaWiki.
+ * Representation of a title within %MediaWiki.
*
* See title.txt
*
* Get a real URL referring to this title, with interwiki link and
* fragment
*
- * See getLocalURL for the arguments.
- *
- * @see self::getLocalURL
+ * @see self::getLocalURL for the arguments.
* @see wfExpandUrl
* @param $query
* @param $query2 bool
}
/**
- * Get a URL with no fragment or server name. If this page is generated
- * with action=render, $wgServer is prepended.
+ * Get a URL with no fragment or server name (relative URL) from a Title object.
+ * If this page is generated with action=render, however,
+ * $wgServer is prepended to make an absolute URL.
+ *
+ * @see self::getFullURL to always get an absolute URL.
+ * @see self::newFromText to produce a Title object.
*
* @param string|array $query an optional query string,
* not used for interwiki links. Can be specified as an associative array as well,
* The second parameter is deprecated since 1.19. Pass it as a key,value
* pair in the first parameter array instead.
*
- * @return String the URL
+ * @return String of the URL.
*/
public function getLocalURL( $query = '', $query2 = false ) {
global $wgArticlePath, $wgScript, $wgServer, $wgRequest;
* The result obviously should not be URL-escaped, but does need to be
* HTML-escaped if it's being output in HTML.
*
- * See getLocalURL for the arguments.
- *
* @param $query
* @param $query2 bool
* @param $proto Protocol to use; setting this will cause a full URL to be used
- * @see self::getLocalURL
+ * @see self::getLocalURL for the arguments.
* @return String the URL
*/
public function getLinkURL( $query = '', $query2 = false, $proto = PROTO_RELATIVE ) {
* Get an HTML-escaped version of the URL form, suitable for
* using in a link, without a server name or fragment
*
- * See getLocalURL for the arguments.
- *
- * @see self::getLocalURL
+ * @see self::getLocalURL for the arguments.
* @param $query string
* @param $query2 bool|string
* @return String the URL
* Get an HTML-escaped version of the URL form, suitable for
* using in a link, including the server name and fragment
*
- * See getLocalURL for the arguments.
- *
- * @see self::getLocalURL
+ * @see self::getLocalURL for the arguments.
* @return String the URL
* @deprecated since 1.19
*/
* if $wgInternalServer is not set. If the server variable used is
* protocol-relative, the URL will be expanded to http://
*
- * See getLocalURL for the arguments.
- *
- * @see self::getLocalURL
+ * @see self::getLocalURL for the arguments.
* @return String the URL
*/
public function getInternalURL( $query = '', $query2 = false ) {
*
* NOTE: Unlike getInternalURL(), the canonical URL includes the fragment
*
- * See getLocalURL for the arguments.
- *
- * @see self::getLocalURL
+ * @see self::getLocalURL for the arguments.
* @return string The URL
* @since 1.18
*/
/**
* HTML-escaped version of getCanonicalURL()
*
- * See getLocalURL for the arguments.
- *
- * @see self::getLocalURL
+ * @see self::getLocalURL for the arguments.
* @since 1.18
* @return string
* @deprecated since 1.19
*
* @deprecated in 1.19; use userCan(), quickUserCan() or getUserPermissionsErrors() instead
* @return Bool
- * @todo fold these checks into userCan()
*/
public function userCanRead() {
wfDeprecated( __METHOD__, '1.19' );
$comment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $reason;
}
// @todo FIXME: $params?
- $log->addEntry( 'move_prot', $nt, $comment, array( $this->getPrefixedText() ), $wgUser );
+ $logId = $log->addEntry( 'move_prot', $nt, $comment, array( $this->getPrefixedText() ), $wgUser );
+
+ // reread inserted pr_ids for log relation
+ $insertedPrIds = $dbw->select(
+ 'page_restrictions',
+ 'pr_id',
+ array( 'pr_page' => $redirid ),
+ __METHOD__
+ );
+ $logRelationsValues = array();
+ foreach ( $insertedPrIds as $prid ) {
+ $logRelationsValues[] = $prid->pr_id;
+ }
+ $log->addRelations( 'pr_id', $logRelationsValues, $logId );
}
# Update watchlists
$dbw->commit( __METHOD__ );
- wfRunHooks( 'TitleMoveComplete', array( &$this, &$nt, &$wgUser, $pageid, $redirid ) );
+ wfRunHooks( 'TitleMoveComplete', array( &$this, &$nt, &$wgUser, $pageid, $redirid, $reason ) );
return true;
}
foreach ( $subpages as $oldSubpage ) {
$count++;
if ( $count > $wgMaximumMovedPages ) {
- $retval[$oldSubpage->getPrefixedTitle()] =
+ $retval[$oldSubpage->getPrefixedText()] =
array( 'movepage-max-pages',
$wgMaximumMovedPages );
break;