* (bug 27333) Fix repetitive last-seen time queries on page history
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 12 Feb 2011 01:10:48 +0000 (01:10 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 12 Feb 2011 01:10:48 +0000 (01:10 +0000)
commit0344a7787eb78c36fc0283337ab020911723419d
treeb552df5e1cfb616ad1583294dfa6393f0c5868e5
parent7a1903ec6b8f8d8aea7f60b33979c733e7d37c45
* (bug 27333) Fix repetitive last-seen time queries on page history

Title::getNotificationTimestamp() is called for every line in HistoryPager, to compare against the revision's timestamp to determine if it's a new edit since the viewer's last visit to the page.
The function kept an internal cache within the Title object to avoid having to make the query over and over in this situation, but in the case that it returns null, the cached entry would be accidentally ignored on the next round due to use of isset() to check for the array entry. (Most of the time it's great, but if the value of the key actually *is* null, isset() returns false.) Switched to array_key_exists(), which doesn't have this false negative. Now only one query gets issued for this on a history page, even if the answer is null.
includes/Title.php