Make sure to pass the right types to LinkBegin
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 14 Sep 2008 00:49:52 +0000 (00:49 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 14 Sep 2008 00:49:52 +0000 (00:49 +0000)
commit5ff39d3b93b78fe0a0f014eb4093fb0fc568a6be
tree82767d60e23db430eff46aad0bd18fa7ebc23bc1
parent1c3805d278491cc51371d22569ca3b1e4726bcb5
Make sure to pass the right types to LinkBegin

If Linker::link() is passed an invalid Title, now that it fails gracefully, we should fail gracefully before passing over to the hook.  In theory some hooks might want to override this, but it's unlikely, because any caller that passes a non-Title is probably buggy and should be fixed anyway.  This saves unexpected fatal errors and/or having to add "if( !$target instanceof Title ) return true;" to the beginning of every function hooking into this.

Also ensure that $options is an array before passing to the hook, just for convenience.
docs/hooks.txt
includes/Linker.php