if( User::isValidEmailAddr( $user->getEmail() ) ) {
global $wgEmailAuthentication;
if( $wgEmailAuthentication ) {
- return $user->getEmailAuthenticationTimestamp() ? true : false;
+ return boolval( $user->getEmailAuthenticationTimestamp() );
} else {
return true;
}
'suppress/block' => 'blocklogentry',
);
+/**
+ * The same as above, but here values are names of functions,
+ * not messages
+ */
+$wgLogActionsHandlers = array();
+
/**
* List of special pages, followed by what subtitle they should go under
* at Special:SpecialPages
/** Generate a random 32-character hexadecimal token.
* @param mixed $salt Some sort of salt, if necessary, to add to random characters before hashing.
*/
- function wfGenerateToken( $salt = '' ) {
+function wfGenerateToken( $salt = '' ) {
$salt = serialize($salt);
return md5( mt_rand( 0, 0x7fffffff ) . $salt );
}
+
+function boolval( $val ) {
+ return $val ? true : false;
+}
}
}
} else {
- wfDebug( "LogPage::actionText - unknown action $key\n" );
- $rv = "$action";
+ global $wgLogActionsHandlers;
+ if( isset( $wgLogActionsHandlers[$key] ) ) {
+ $args = func_get_args();
+ $rv = call_user_func_array( $wgLogActionsHandlers[$key], $args );
+ } else {
+ wfDebug( "LogPage::actionText - unknown action $key\n" );
+ $rv = "$action";
+ }
}
if( $filterWikilinks ) {
$rv = str_replace( "[[", "", $rv );