r100396 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100395‎ | r100396 | r100397 >
Date:00:09, 21 October 2011
Author:johnduhart
Status:ok (Comments)
Tags:
Comment:
Bugfix to r96441, class_exists throws warnings when arrays are passed to it
Modified paths:
  • /trunk/phase3/includes/logging/LogFormatter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/logging/LogFormatter.php
@@ -36,7 +36,7 @@
3737 $handler = $wgLogActionsHandlers[$wildcard];
3838 }
3939
40 - if ( $handler !== '' && class_exists( $handler ) ) {
 40+ if ( $handler !== '' && !is_array( $handler ) && class_exists( $handler ) ) {
4141 return new $handler( $entry );
4242 }
4343

Follow-up revisions

RevisionCommit summaryAuthorDate
r100447Followup r100396, use is_string instead of !is_arrayjohnduhart20:24, 21 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96441Committing my new logging classes for review. Will later commit changes that ...nikerabbit15:32, 7 September 2011

Comments

#Comment by Nikerabbit (talk | contribs)   06:41, 21 October 2011

Maybe is_string would be even better (whitelist over blacklist). It's unfair that PHP can add primitive type annotation for it's functions while it is not possible for newly created functions.

#Comment by Johnduhart (talk | contribs)   20:24, 21 October 2011

Good idea, r100447.

Status & tagging log