empty string test for old page_restricions entries
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 16 May 2012 19:14:40 +0000 (21:14 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Wed, 16 May 2012 19:14:40 +0000 (21:14 +0200)
some old page_restricions entries are move=:edit=,
which result in any empty string as level in the JS var
wgRestrictionEdit

Checking wgRestrictionEdit.length is than not possible

Change-Id: I250b4f9bda60361d4cd8c3139b17b299fec0a718

includes/Title.php

index 4f0a897..cf428f9 100644 (file)
@@ -2555,7 +2555,10 @@ class Title {
                                        $this->mRestrictions['edit'] = explode( ',', trim( $temp[0] ) );
                                        $this->mRestrictions['move'] = explode( ',', trim( $temp[0] ) );
                                } else {
-                                       $this->mRestrictions[$temp[0]] = explode( ',', trim( $temp[1] ) );
+                                       $restriction = trim( $temp[1] );
+                                       if( $restriction != '' ) { //some old entries are empty
+                                               $this->mRestrictions[$temp[0]] = explode( ',', $restriction );
+                                       }
                                }
                        }