# HG changeset patch # User Dan # Date 1238898852 14400 # Node ID b24601274cd2f254f3ae6192405c184d08a3f949 # Parent 668e6a9adf99cc1de5d381f574ee3298226dfc62 SpecialUserPrefs: fixed: userprefs_body hook only allowed first loaded plugin to work diff -r 668e6a9adf99 -r b24601274cd2 includes/plugins.php --- a/includes/plugins.php Sat Apr 04 22:24:49 2009 -0400 +++ b/includes/plugins.php Sat Apr 04 22:34:12 2009 -0400 @@ -54,7 +54,7 @@ * @var array */ - var $system_plugins = Array('SpecialUserFuncs.php','SpecialUserPrefs.php','SpecialPageFuncs.php','SpecialAdmin.php','SpecialCSS.php','SpecialUpdownload.php','SpecialSearch.php','PrivateMessages.php','SpecialGroups.php', 'SpecialRecentChanges.php', 'DemoMode.php'); + var $system_plugins = Array('SpecialUserFuncs.php','SpecialUserPrefs.php','SpecialPageFuncs.php','SpecialAdmin.php','SpecialCSS.php','SpecialUpdownload.php','SpecialSearch.php','PrivateMessages.php','SpecialGroups.php', 'SpecialLog.php', 'DemoMode.php'); /** * Name kept for compatibility. Effectively a constructor. Calculates the list of plugins that should be loaded @@ -122,10 +122,13 @@ * @param array Deprecated. */ - function setHook($name, $opts = Array()) + function setHook($name, $dont_split = false) { if ( !empty($this->hook_list[$name]) && is_array($this->hook_list[$name]) ) { + if ( $dont_split ) + return $this->hook_list[$name]; + return array(implode("\n", $this->hook_list[$name])); } else diff -r 668e6a9adf99 -r b24601274cd2 plugins/SpecialUserPrefs.php --- a/plugins/SpecialUserPrefs.php Sat Apr 04 22:24:49 2009 -0400 +++ b/plugins/SpecialUserPrefs.php Sat Apr 04 22:34:12 2009 -0400 @@ -1040,7 +1040,7 @@ break; default: $good = false; - $code = $plugins->setHook('userprefs_body'); + $code = $plugins->setHook('userprefs_body', true); foreach ( $code as $cmd ) { if ( eval($cmd) )