Index: trunk/phase3/includes/ResourceLoader.php |
— | — | @@ -199,6 +199,12 @@ |
200 | 200 | // A module has already been registered by this name |
201 | 201 | throw new MWException( 'Another module has already been registered as ' . $name ); |
202 | 202 | } |
| 203 | + |
| 204 | + // Validate the input (type hinting lets null through) |
| 205 | + if ( !( $object instanceof ResourceLoaderModule ) ) { |
| 206 | + throw new MWException( 'Invalid ResourceLoader module error. Instances of ResourceLoaderModule expected.' ); |
| 207 | + } |
| 208 | + |
203 | 209 | // Attach module |
204 | 210 | $this->modules[$name] = $object; |
205 | 211 | $object->setName( $name ); |