/** * Callback function to validate data * @return bool must return true or other hooks don't get called */ function validateName($editPage, $textBox1, $section, &$hookError) { $ns = $editPage->mTitle->getNamespace(); if ($ns == NS_GIVEN_NAME || $ns == NS_SURNAME) { $name = new Name($ns, $editPage->mTitle->getText()); $name->validate($textBox1, $section, $hookError); } return true; }