r39518 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39517‎ | r39518 | r39519 >
Date:05:06, 17 August 2008
Author:krimpet
Status:old
Tags:
Comment:
Per request in bug 15194, add more syntax for Special:Log, similar to Special:ListUsers changes in r39269
Modified paths:
  • /trunk/phase3/includes/specials/SpecialLog.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialLog.php
@@ -26,10 +26,21 @@
2727 * constructor
2828 */
2929 function wfSpecialLog( $par = '' ) {
30 - global $wgRequest, $wgOut, $wgUser;
 30+ global $wgRequest, $wgOut, $wgUser, $wgLogTypes;
 31+
3132 # Get parameters
32 - $type = $wgRequest->getVal( 'type', $par );
33 - $user = $wgRequest->getText( 'user' );
 33+ $parms = explode( '/', ($par = ( $par !== null ) ? $par : '' ) );
 34+ $symsForAll = array( '*', 'all' );
 35+ if ( $parms[0] != '' && ( in_array( $par, $wgLogTypes ) || in_array( $par, $symsForAll ) ) ) {
 36+ $type = $par;
 37+ $user = $wgRequest->getText( 'user' );
 38+ } else if ( count( $parms ) == 2 ) {
 39+ $type = $parms[0];
 40+ $user = $parms[1];
 41+ } else {
 42+ $type = $wgRequest->getVal( 'group' );
 43+ $user = ( $par != '' ) ? $par : $wgRequest->getText( 'user' );
 44+ }
3445 $title = $wgRequest->getText( 'page' );
3546 $pattern = $wgRequest->getBool( 'pattern' );
3647 $y = $wgRequest->getIntOrNull( 'year' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r39595Revert r39518. Fucks up type selector. Does anybody test this stuff?aaron17:38, 18 August 2008
r39599Restore r39518 with fix. No need to be snarky :/krimpet18:11, 18 August 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r39269Per bug 15146, allow additional syntax for Special:Listusers URLs....krimpet02:37, 13 August 2008

Status & tagging log