Matthias Mullie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/163839

Change subject: (bug 71109) Don't fail Special:EditWatchlist when there's an 
invalid UUID in watchlist
......................................................................

(bug 71109) Don't fail Special:EditWatchlist when there's an invalid UUID in 
watchlist

Bug: 71109
Change-Id: I3409bdc64fbb7120259d478fa47f5da6afbe2c09
---
M Hooks.php
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/39/163839/1

diff --git a/Hooks.php b/Hooks.php
index ddaaf46..8360cdd 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -954,8 +954,13 @@
                // build array of queries to be executed all at once
                $queries = array();
                foreach( $ids as $id ) {
-                       $uuid = UUID::create( strtolower( $id ) );
-                       $queries[] = array( 'rev_type_id' => $uuid );
+                       try {
+                               $uuid = UUID::create( strtolower( $id ) );
+                               $queries[] = array( 'rev_type_id' => $uuid );
+                       } catch ( \Exception $e ) {
+                               // invalid id
+                               unset( $watchlistInfo[NS_TOPIC][$id] );
+                       }
                }
 
                /*

-- 
To view, visit https://gerrit.wikimedia.org/r/163839
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3409bdc64fbb7120259d478fa47f5da6afbe2c09
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

Reply via email to