From: umherirrender Date: Wed, 16 Apr 2014 17:20:36 +0000 (+0200) Subject: Allow LogEntry::setRelations to work with array(tag => value) X-Git-Tag: 1.31.0-rc.0~15698 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22lang_raccourcis%22%2C%22module=%24nom_module%22%29%20.%20%22?a=commitdiff_plain;h=d2effb755b5dee8fd93af991766b847979365ce7;p=lhc%2Fweb%2Fwiklou.git Allow LogEntry::setRelations to work with array(tag => value) Change-Id: I5a3d9799cd2125a02871b1c6a9ef7745eadb518d --- diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index c7f9e40c5d..d893be5d30 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -407,7 +407,7 @@ class ManualLogEntry extends LogEntryBase { * Declare arbitrary tag/value relations to this log entry. * These can be used to filter log entries later on. * - * @param array $relations Map of (tag => (list of values)) + * @param array $relations Map of (tag => (list of values|value)) * @since 1.22 */ public function setRelations( array $relations ) { @@ -512,6 +512,11 @@ class ManualLogEntry extends LogEntryBase { if ( !strlen( $tag ) ) { throw new MWException( "Got empty log search tag." ); } + + if ( !is_array( $values ) ) { + $values = array( $values ); + } + foreach ( $values as $value ) { $rows[] = array( 'ls_field' => $tag,