Index: trunk/phase3/includes/Parser.php |
— | — | @@ -2835,6 +2835,10 @@ |
2836 | 2836 | $allArgs = array_merge( $initialArgs, $funcArgs ); |
2837 | 2837 | } |
2838 | 2838 | |
| 2839 | + # Workaround for PHP bug 35229 and similar |
| 2840 | + if ( !is_callable( $callback ) ) { |
| 2841 | + throw new MWException( "Tag hook for $name is not callable\n" ); |
| 2842 | + } |
2839 | 2843 | $result = call_user_func_array( $callback, $allArgs ); |
2840 | 2844 | $found = true; |
2841 | 2845 | |
— | — | @@ -3239,6 +3243,10 @@ |
3240 | 3244 | break; |
3241 | 3245 | default: |
3242 | 3246 | if( isset( $this->mTagHooks[$name] ) ) { |
| 3247 | + # Workaround for PHP bug 35229 and similar |
| 3248 | + if ( !is_callable( $this->mTagHooks[$name] ) ) { |
| 3249 | + throw new MWException( "Tag hook for $name is not callable\n" ); |
| 3250 | + } |
3243 | 3251 | $output = call_user_func_array( $this->mTagHooks[$name], |
3244 | 3252 | array( $content, $attributes, $this ) ); |
3245 | 3253 | } else { |