Follow-up to I17ac68014840daa47bfd4768e978e9ff2edb00db.
Replaces some ==/!= with ===/!== and other code style
changes mentioned in Gerrit comments on previous patchset.
Change-Id: I50da16bc62241491ac5c4948e0d3059b21f113dc
Added new argument to the Linker options array to allow
the forcing of an HTTP or HTTPS protocol. In order to facilitate
this, a protocol argument was added to Title::getLinkURL.
Also, an options argument was added to OutputPage::addReturnTo
so that options can be passed to the linker and so that the
returnto URL can be forced to a certain protocol.
Change-Id: Ia9cc11e310ad6ef23c221bdba3a4834e7c5556e7
Respecting rd_interwiki is needed to act the same way than
Special:Whatlinkshere. For local redirects it is needed to also check
for NULL, not only the empty string
Change-Id: I4f3f242d69054dcbb3c7a02441991196ba140986
Last round of easy replacements. About 30 uses in core remain (outside of HISTORY
and GlobalFunctions::wfMsg*). I'll work with IAlex and Nikerabbit to work towards
getting rid of those, too.
Updated method documentation in a few places.
Change-Id: I2491c006b62a9cc183230e31a0bd96c91e5b6142
Added parameter to Title::getFullURL to allow specification
of a protocol rather than assuming PROTO_RELATIVE. Also
added an accompanying parameter to Skin::makeSpecialUrl
to make a link for a specific protocol.
Cleaned up the creation of personal URLs in SkinTemplate.php
so that when $wgSecureLogin is enabled, the returnto
query is not lost in the process.
Note: This will only work if $wgServer is set to a
protocol relative URL.
Change-Id: Iba48eb3620fb3a721220364185f7abfd902412d0
Signed-off-by: Tyler Romeo <tylerromeo@gmail.com>
Even when $auth=false, moveToInternal() would unconditionally check
$wgUser's 'suppressredirect' permissions and override $createRedirect.
This means it was impossible to suppress redirect creation when moving
pages in a maintenance script, even when telling moveTo() to disable
permissions checks.
Fixed by moving the check from moveToInternal() up into moveTo() and
respecting $auth there
Change-Id: I9b52dc67c7ae2dbda3ca62f78d4d7df118771c0f
* The problem is that Title::userIsWatching() relies on $wgUser,
which is not suitable on every case. Instead User::isWatched()
requires both an User and a Title object.
* Replaced all core calls from the former to the latter
* Added a cache in User for the WatchedItem instances so we do not
need to do a database request every time something want to know
whether a page is watched or not, which can happen several times
per request.
Change-Id: Ifa9c55b7ffb487ce6893c74df233eedc7654dc5e
Also pluralize properly.
"You have a new message from another user (last change)"
if only one unseen revision, or
"You have new messages [from another user|from N users|]
(last changes)" if there are several unseen revisions.
Contains a fix in Title::countAuthorsBetween() adding options to include
(one or both of) the delimiting revisions in the count.
Change-Id: I8870111802085d0bd188cb508c4f4b852985634d
MediaWiki:NotConversiontable/zh-cn and
MediaWiki:Conversiontable2/zh-cn are not conversion tables.
Change-Id: Id132330e20e1a33985aa336b1c26268b036f2dad
isRedirect() assumes that the LinkCache already contains
information about this title. If that is not the case, it
currently returns false, even though it just doesn't know
whether this link is a redirect.
The new check asserts the assumption that this title
is already known to the link cache.
Amend: use Exception instead of assert()
Change-Id: Id3ad2d4e140b270b1f5ca1f7af9b3320cffff5a2
some old page_restricions entries are move=:edit=,
which result in any empty string as level in the JS var
wgRestrictionEdit
Checking wgRestrictionEdit.length is than not possible
Change-Id: I250b4f9bda60361d4cd8c3139b17b299fec0a718
This entails some refactoring to actually surface the log_id all the way
up:
* Made doDeleteArticleReal() return a Status object rather than a
constant, and put the log_id in $status->value. This Status object is
also passed to the ArticleDelete hook.
* Kept doDeleteArticle() the same for extension compatibility.
* Switched all core callers of doDeleteArticle() to
doDeleteArticleReal() and surfaced the error message from the Status
if appropriate, rather than hardcoding 'cannotdelete' all over the
place.
* Exposed the log_id in ApiDelete
* Add 'delete-hook-aborted' message for when a hook aborts the deletion
but does not provide an error message. Previously this just caused the
'cannotdelete' message to appear.
Change-Id: Ia6415b390d5d4172ce96667f46ccdba2be02461f
No idea why mysql_fetch_object() returns string when the field in defined as integer, but it is so on my machine...
Change-Id: I353c6087d20d7a72d6d4b39bdc477b094bc460f6
Title.php at line 4313:
array( 'wl_namespace' => $this->getNamespace(),
'wl_title' => $this->getDBkey(),
'wl_user' => $user->getId()
),
In UserMailer.php at line 438:
array(
'wl_title' => $title->getDBkey(),
'wl_namespace' => $title->getNamespace(),
'wl_user != ' . intval( $editor->getID() ),
'wl_notificationtimestamp IS NULL',
)
And line 455:
array( /* WHERE */
'wl_title' => $title->getDBkey(),
'wl_namespace' => $title->getNamespace(),
'wl_user' => $watchers
)
CREATE TABLE /*_*/watchlist (
-- Key to user.user_id
wl_user int unsigned NOT NULL,
-- Key to page_namespace/page_title
-- Note that users may watch pages which do not exist yet,
-- or existed in the past but have been deleted.
wl_namespace int NOT NULL default 0,
wl_title varchar(255) binary NOT NULL default '',
-- Timestamp when user was last sent a notification e-mail;
-- cleared when the user visits the page.
wl_notificationtimestamp varbinary(14)
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);
Change-Id: I633c009b4a1c614b966c69f042f94c2056e03784
LinkBatch can also give subpages to the GenderCache and therefor it is
easier to do it always in GenderCache, than in LinkBatch and Title
Add unit tests for GenderCache
Change-Id: Ia936ff8bb639a197b0b3a8e07c97a66edd57dd10
Means the evaluation of if ( is_array( $err ) ) { is always going to be false
Update the documentation
Change-Id: I0016495563e715a2a1927e227ec2bb5c80b5378b
Namespace existence has to be checked before calling Title::makeName() because otherwise it will fallback to a page with the same name, but in the main namespace which is not what we want here.
Change-Id: I8c087390044c54dd0502c1b8bb9321dfaec6b5f7