Bug in RSS Image Feed options page
-
There is a bug in the options page, causing all checkboxes to be checked irregardless of their submitted state.
The the bug is in
RIF_AdminClass#validate_options
, where a field is assignedtrue
if it merely exists in the function input.The fields must also be checked for their value, as the function is invoked twice on save, and on the second round the fields are already mapped to their appropriate boolean value.
I’m not sure whether this has to do with me running this plugin in a network.
Here are the stack traces from
RIF_AdminClass#validate_options
on options save:array ( 0 => array ( 'file' => '[...]/wordpress/wp-content/plugins/rss-image-feed/class-lib/RIF_AdminClass.php', 'line' => 88, 'function' => 'validate_options', 'class' => 'RIF_Admin', 'object' => RIF_Admin::__set_state(array( )), 'type' => '->', 'args' => array ( 0 => array ( 'image_size' => '400', 'responsive' => '1', 'image_number' => '', 'force_excerpt' => '1', 'excerpt_size' => '5', ), ), ), 1 => array ( 'file' => '[...]/wordpress/wp-includes/plugin.php', 'line' => 525, 'function' => 'build_options_page', 'class' => 'RIF_Admin', 'object' => RIF_Admin::__set_state(array( )), 'type' => '->', 'args' => array ( 0 => '', ), ), 2 => array ( 'file' => '[...]/wordpress/wp-admin/admin.php', 'line' => 236, 'function' => 'do_action', 'args' => array ( 0 => 'toplevel_page_rss-image-feed', ), ), 3 => array ( 'file' => '[...]/wordpress/wp-admin/network/admin.php', 'line' => 13, 'args' => array ( 0 => '[...]/wordpress/wp-admin/admin.php', ), 'function' => 'require_once', ), )
Followed by:
array ( 0 => array ( 'file' => '[...]/wordpress/wp-includes/plugin.php', 'line' => 235, 'function' => 'validate_options', 'class' => 'RIF_Admin', 'object' => RIF_Admin::__set_state(array( )), 'type' => '->', 'args' => array ( 0 => array ( 'image_size' => 400, 'force_excerpt' => true, 'excerpt_size' => 5, 'version' => '4.2', 'sitewide' => true, 'responsive' => true, 'enclosure' => false, 'media_content' => false, 'cache' => array ( ), 'image_number' => '', 'notext' => false, ), ), ), 1 => array ( 'file' => '[...]/wordpress/wp-includes/formatting.php', 'line' => 3882, 'function' => 'apply_filters', 'args' => array ( 0 => 'sanitize_option_rss_options', 1 => array ( 'image_size' => 400, 'force_excerpt' => true, 'excerpt_size' => 5, 'version' => '4.2', 'sitewide' => true, 'responsive' => true, 'enclosure' => false, 'media_content' => false, 'cache' => array ( ), 'image_number' => '', 'notext' => false, ), 2 => 'rss_options', 3 => array ( 'image_size' => 400, 'force_excerpt' => true, 'excerpt_size' => 5, 'version' => '4.2', 'sitewide' => true, 'responsive' => true, 'enclosure' => false, 'media_content' => false, 'cache' => array ( ), 'image_number' => '', 'notext' => false, ), ), ), 2 => array ( 'file' => '[...]/wordpress/wp-includes/option.php', 'line' => 1436, 'function' => 'sanitize_option', 'args' => array ( 0 => 'rss_options', 1 => array ( 'image_size' => 400, 'force_excerpt' => true, 'excerpt_size' => 5, 'version' => '4.2', 'sitewide' => true, 'responsive' => true, 'enclosure' => false, 'media_content' => false, 'cache' => array ( ), 'image_number' => '', 'notext' => false, ), ), ), 3 => array ( 'file' => '[...]/wordpress/wp-content/plugins/rss-image-feed/class-lib/RIF_AdminClass.php', 'line' => 90, 'function' => 'update_network_option', 'args' => array ( 0 => 1, 1 => 'rss_options', 2 => array ( 'image_size' => 400, 'force_excerpt' => true, 'excerpt_size' => 5, 'version' => '4.2', 'sitewide' => true, 'responsive' => true, 'enclosure' => false, 'media_content' => false, 'cache' => array ( ), 'image_number' => '', 'notext' => false, ), ), ), 4 => array ( 'file' => '[...]/wordpress/wp-includes/plugin.php', 'line' => 525, 'function' => 'build_options_page', 'class' => 'RIF_Admin', 'object' => RIF_Admin::__set_state(array( )), 'type' => '->', 'args' => array ( 0 => '', ), ), 5 => array ( 'file' => '[...]/wordpress/wp-admin/admin.php', 'line' => 236, 'function' => 'do_action', 'args' => array ( 0 => 'toplevel_page_rss-image-feed', ), ), 6 => array ( 'file' => '[...]/wordpress/wp-admin/network/admin.php', 'line' => 13, 'args' => array ( 0 => '[...]/wordpress/wp-admin/admin.php', ), 'function' => 'require_once', ), )
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Bug in RSS Image Feed options page’ is closed to new replies.