Server IP : 104.21.14.103 / Your IP : 3.142.249.59 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/self/cwd/wp-content/plugins/wordpress-seo/inc/indexables/validators/ |
Upload File : |
<?php /** * WPSEO plugin file. * * @package WPSEO\Indexables */ /** * Class WPSEO_Robots_Validator. */ class WPSEO_Robots_Validator implements WPSEO_Endpoint_Validator { /** * The robots keys to validate. * * @var array */ private $robots_to_validate = [ 'is_robots_nofollow', 'is_robots_noarchive', 'is_robots_noimageindex', 'is_robots_nosnippet', 'is_robots_noindex', ]; /** * Validates the passed request data. * * @param array $request_data The request data to validate. * * @return void * * @throws WPSEO_Invalid_Argument_Exception Thrown if the robots values are not a boolean type. */ public function validate( $request_data ) { foreach ( $this->robots_to_validate as $item ) { if ( ! WPSEO_Validator::key_exists( $request_data, $item ) ) { continue; } if ( ! is_null( $request_data[ $item ] ) && ! WPSEO_Validator::is_boolean( $request_data[ $item ] ) ) { throw WPSEO_Invalid_Argument_Exception::invalid_boolean_parameter( $request_data[ $item ], $item ); } } } }