Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2597,8 +2597,12 @@ |
2598 | 2598 | /** Generate a random 32-character hexadecimal token. |
2599 | 2599 | * @param mixed $salt Some sort of salt, if necessary, to add to random characters before hashing. |
2600 | 2600 | */ |
2601 | | - function wfGenerateToken( $salt = '' ) { |
| 2601 | +function wfGenerateToken( $salt = '' ) { |
2602 | 2602 | $salt = serialize($salt); |
2603 | 2603 | |
2604 | 2604 | return md5( mt_rand( 0, 0x7fffffff ) . $salt ); |
2605 | 2605 | } |
| 2606 | + |
| 2607 | +function boolval( $val ) { |
| 2608 | + return $val ? true : false; |
| 2609 | +} |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2592,6 +2592,12 @@ |
2593 | 2593 | ); |
2594 | 2594 | |
2595 | 2595 | /** |
| 2596 | + * The same as above, but here values are names of functions, |
| 2597 | + * not messages |
| 2598 | + */ |
| 2599 | +$wgLogActionsHandlers = array(); |
| 2600 | + |
| 2601 | +/** |
2596 | 2602 | * List of special pages, followed by what subtitle they should go under |
2597 | 2603 | * at Special:SpecialPages |
2598 | 2604 | */ |
Index: trunk/phase3/includes/Autopromote.php |
— | — | @@ -87,7 +87,7 @@ |
88 | 88 | if( User::isValidEmailAddr( $user->getEmail() ) ) { |
89 | 89 | global $wgEmailAuthentication; |
90 | 90 | if( $wgEmailAuthentication ) { |
91 | | - return $user->getEmailAuthenticationTimestamp() ? true : false; |
| 91 | + return boolval( $user->getEmailAuthenticationTimestamp() ); |
92 | 92 | } else { |
93 | 93 | return true; |
94 | 94 | } |
Index: trunk/phase3/includes/LogPage.php |
— | — | @@ -223,8 +223,14 @@ |
224 | 224 | } |
225 | 225 | } |
226 | 226 | } else { |
227 | | - wfDebug( "LogPage::actionText - unknown action $key\n" ); |
228 | | - $rv = "$action"; |
| 227 | + global $wgLogActionsHandlers; |
| 228 | + if( isset( $wgLogActionsHandlers[$key] ) ) { |
| 229 | + $args = func_get_args(); |
| 230 | + $rv = call_user_func_array( $wgLogActionsHandlers[$key], $args ); |
| 231 | + } else { |
| 232 | + wfDebug( "LogPage::actionText - unknown action $key\n" ); |
| 233 | + $rv = "$action"; |
| 234 | + } |
229 | 235 | } |
230 | 236 | if( $filterWikilinks ) { |
231 | 237 | $rv = str_replace( "[[", "", $rv ); |