TYPO3 CMS  TYPO3_6-2
IpValidator.php
Go to the documentation of this file.
1 <?php
3 
23 
29  const LOCALISATION_OBJECT_NAME = 'tx_form_system_validate_ip';
30 
37  public function isValid() {
38  if ($this->requestHandler->has($this->fieldName)) {
39  $value = $this->requestHandler->getByMethod($this->fieldName);
40  if (!preg_match('/\\b(([01]?\\d?\\d|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d?\\d|2[0-4]\\d|25[0-5])\\b/', $value)) {
41  return FALSE;
42  }
43  }
44  return TRUE;
45  }
46 
47 }