getMessage(), $backtrace_summary));// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- Using for debugging purpose return $default; } } } if (null !== $type && strtolower(gettype($putative_return)) !== strtolower($type)) { $backtrace_summary = \WP_Optimize_Utils::get_backtrace_summary(); error_log(sprintf('WP-Optimize: fetch_superglobal() failed due to type mismatch - expected "%s", received "%s" [%s]', $type, gettype($putative_return), $backtrace_summary)); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- Using for debugging purpose return $default; } return $putative_return; } /** * Used to verify a nonce * * @param string $name Nonce name * @param string|int $action Nonce action * * @return bool */ function verify_nonce($name, $action = -1) { $name = fetch_superglobal('request', $name, null, 'sanitize_key'); if (null === $name) { return false; } if (function_exists('wp_verify_nonce')) { if (wp_verify_nonce($name, $action)) { return true; } } $backtrace_summary = \WP_Optimize_Utils::get_backtrace_summary(); error_log(sprintf('WP-Optimize: verify_nonce() failed for action "%s" [%s]', $action, $backtrace_summary)); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- Using for debugging purpose return false; }