r107422 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107421‎ | r107422 | r107423 >
Date:21:12, 27 December 2011
Author:laner
Status:ok (Comments)
Tags:
Comment:
Use implode rather than a poor foreach equivalent. Follow up to r107415.
Modified paths:
  • /trunk/extensions/OpenStackManager/OpenStackNovaPuppetGroup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/OpenStackNovaPuppetGroup.php
@@ -110,11 +110,9 @@
111111 $condition = '';
112112 if ( $projects ) {
113113 $condition .= 'group_project =';
114 - foreach ( $projects as $project ) {
115 - $condition .= $project . ',';
116 - }
117 - $condition = $dbr->addQuotes( $condition );
118 - $condition = $condition[0,-1];
 114+ $projects = implode( ',', $projects );
 115+ $projects = $dbr->addQuotes( $projects );
 116+ $condition .= $projects;
119117 }
120118 $rows = $dbr->select(
121119 'openstack_puppet_groups',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r107415* Compatibility with LdapAuthentication 2.0a ldap function wrappers...laner20:36, 27 December 2011

Comments

#Comment by Nikerabbit (talk | contribs)   17:35, 13 January 2012

Which didn't even work.

Status & tagging log