From 7b8e963c8899d0791ab7a6a90a43d684244e1823 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Wed, 16 May 2012 21:14:40 +0200 Subject: [PATCH] empty string test for old page_restricions entries 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/Title.php b/includes/Title.php index 4f0a897433..cf428f918b 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 ); + } } } -- 2.20.1