public function block_long_urls() { if (strlen($_SERVER['REQUEST_URI']) <= 255) { return; } if (is_admin()) { return; } if (defined('WP_CLI') && WP_CLI) { return; } if (ITSEC_Core::is_iwp_call()) { return; } if (strpos($_SERVER['REQUEST_URI'], 'infinity=scrolling&action=infinite_scroll')) { return; } // TODO: These checks should not be part of the "Filter Long URL Strings" feature. if (strpos($_SERVER['REQUEST_URI'], 'eval(') || strpos($_SERVER['REQUEST_URI'], 'CONCAT') || strpos($_SERVER['REQUEST_URI'], 'UNION+SELECT') || strpos($_SERVER['REQUEST_URI'], 'base64')) { @header('HTTP/1.1 414 Request-URI Too Long'); @header('Status: 414 Request-URI Too Long'); @header('Cache-Control: no-cache, must-revalidate'); @header('Expires: Thu, 22 Jun 1978 00:28:00 GMT'); @header('Connection: Close'); @exit; } }
public function init() { if (ITSEC_Core::is_iwp_call()) { return; } if (current_user_can('manage_options')) { return; } $settings = ITSEC_Modules::get_settings('multisite-tweaks'); if ($settings['theme_updates']) { remove_action('load-update-core.php', 'wp_update_themes'); add_filter('pre_site_transient_update_themes', '__return_null'); wp_clear_scheduled_hook('wp_update_themes'); } if ($settings['plugin_updates']) { remove_action('load-update-core.php', 'wp_update_plugins'); add_filter('pre_site_transient_update_plugins', '__return_null'); wp_clear_scheduled_hook('wp_update_plugins'); } if ($settings['core_updates']) { remove_action('admin_notices', 'update_nag', 3); add_filter('pre_site_transient_update_core', '__return_null'); wp_clear_scheduled_hook('wp_version_check'); } }
public function block_long_urls() { if (strlen($_SERVER['REQUEST_URI']) <= 255) { return; } if (is_admin()) { return; } if (defined('WP_CLI') && WP_CLI) { return; } if (ITSEC_Core::is_iwp_call()) { return; } if (strpos($_SERVER['REQUEST_URI'], 'infinity=scrolling&action=infinite_scroll')) { return; } @header('HTTP/1.1 414 Request-URI Too Long'); @header('Status: 414 Request-URI Too Long'); @header('Cache-Control: no-cache, must-revalidate'); @header('Expires: Thu, 22 Jun 1978 00:28:00 GMT'); @header('Connection: Close'); @exit; }