Matthias Mullie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/125963
Change subject: Fix potential issue in ::convertUUIDs
......................................................................
Fix potential issue in ::convertUUIDs
$array argument may not be an array, and ::makeArray is used to
turn it into an array if it isn't already.
Later, however, when a UUID is discovered, it's replaced IN $array,
which may not actually be an array...
This could happen if $array argument if fed a UUID object.
For the loop, that object is converted to an array (will at that
point be a array( UUID )). a UUID will be discovered and attempted
to replace the value in $array, which is still just the UUID object.
Change-Id: I7e753b0ef5936f222af3463fc719044a3d2d0a4f
---
M includes/Model/UUID.php
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/63/125963/1
diff --git a/includes/Model/UUID.php b/includes/Model/UUID.php
index 1c9136f..08299f8 100644
--- a/includes/Model/UUID.php
+++ b/includes/Model/UUID.php
@@ -264,7 +264,8 @@
* @return array
*/
public static function convertUUIDs( $array ) {
- foreach( ObjectManager::makeArray( $array ) as $key => $value )
{
+ $array = ObjectManager::makeArray( $array );
+ foreach( $array as $key => $value ) {
if ( $value instanceof UUID ) {
$array[$key] = $value->getBinary();
}
--
To view, visit https://gerrit.wikimedia.org/r/125963
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e753b0ef5936f222af3463fc719044a3d2d0a4f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits