Index: trunk/extensions/SemanticForms/specials/SF_UploadWindow2.php |
— | — | @@ -1086,15 +1086,17 @@ |
1087 | 1087 | } |
1088 | 1088 | |
1089 | 1089 | global $wgVersion; |
| 1090 | +$uceMethod = new ReflectionMethod( 'SpecialPage', 'userCanExecute' ); |
| 1091 | +$uceParams = $uceMethod->getParameters(); |
1090 | 1092 | // @TODO The "User" class was added to the function header |
1091 | 1093 | // for SpecialPage::userCanExecute in MW 1.18 (r86407) - somehow |
1092 | 1094 | // both the old and new signatures need to be supported. When support |
1093 | 1095 | // is dropped for MW below 1.18 this should be reintegrated into one |
1094 | 1096 | // class. |
1095 | | -if ( version_compare( $wgVersion, '1.18alpha', '<' )) { |
| 1097 | +if ( $uceParams[0]->getClass() ) { // found a class definition for param $user |
1096 | 1098 | |
1097 | 1099 | /** |
1098 | | - * Class variant for MW up to 1.17 |
| 1100 | + * Class variant for MW 1.18+ |
1099 | 1101 | */ |
1100 | 1102 | class SFUploadWindow2 extends SFUploadWindow2Proto { |
1101 | 1103 | /** |
— | — | @@ -1105,7 +1107,7 @@ |
1106 | 1108 | * @param User $user |
1107 | 1109 | * @return bool |
1108 | 1110 | */ |
1109 | | - public function userCanExecute( $user ) { |
| 1111 | + public function userCanExecute( User $user ) { |
1110 | 1112 | return UploadBase::isEnabled() && parent::userCanExecute( $user ); |
1111 | 1113 | } |
1112 | 1114 | |
— | — | @@ -1115,7 +1117,7 @@ |
1116 | 1118 | } else { |
1117 | 1119 | |
1118 | 1120 | /** |
1119 | | - * Class variant for MW 1.18+ |
| 1121 | + * Class variant for MW up to 1.17 |
1120 | 1122 | */ |
1121 | 1123 | class SFUploadWindow2 extends SFUploadWindow2Proto { |
1122 | 1124 | /** |
— | — | @@ -1126,7 +1128,7 @@ |
1127 | 1129 | * @param User $user |
1128 | 1130 | * @return bool |
1129 | 1131 | */ |
1130 | | - public function userCanExecute( User $user ) { |
| 1132 | + public function userCanExecute( $user ) { |
1131 | 1133 | return UploadBase::isEnabled() && parent::userCanExecute( $user ); |
1132 | 1134 | } |
1133 | 1135 | } |