diff --git a/addon/oembed/oembed.php b/addon/oembed/oembed.php index f5be44194c..7e677fd6f5 100644 --- a/addon/oembed/oembed.php +++ b/addon/oembed/oembed.php @@ -18,13 +18,15 @@ function oembed_install() { function oembed_uninstall() { unregister_hook('jot_tool', 'addon/oembed/oembed.php', 'oembed_hook_jot_tool'); unregister_hook('page_header', 'addon/oembed/oembed.php', 'oembed_hook_page_header'); + unregister_hook('plugin_settings', 'addon/oembed/oembed.php', 'oembed_settings'); + unregister_hook('plugin_settings_post', 'addon/oembed/oembed.php', 'oembed_settings_post'); } -function oembed_settings_post(){ +function oembed_settings_post($a,$b){ if(! local_user()) return; if (isset($_POST['oembed-submit'])){ - set_pconfig(local_user(), 'oembed', 'use_for_youtube', (isset($_POST['oembed_use_for_youtube'])?1:0)); + set_pconfig(local_user(), 'oembed', 'use_for_youtube', (isset($_POST['oembed_use_for_youtube'])? intval($_POST['oembed_use_for_youtube']):0)); notice( t('OEmbed settings updated') . EOL); } } @@ -32,7 +34,7 @@ function oembed_settings_post(){ function oembed_settings(&$a,&$o) { if(! local_user()) return; - $uofy = get_pconfig(local_user(), 'oembed', 'use_for_youtube' ); + $uofy = intval(get_pconfig(local_user(), 'oembed', 'use_for_youtube' )); $o.='