Skip to content
Browse files

Make tests run on PHP 7

  • Loading branch information...
1 parent 9d5b330 commit a22b5cf2c7e4b4cf366c311150721961d9b456ea @cweiske cweiske committed Jul 16, 2015
Showing with 4 additions and 2 deletions.
  1. +1 −0 .travis.yml
  2. +2 −1 Validate.php
  3. +1 −1 tests/bug8851.phpt
View
1 .travis.yml
@@ -1,5 +1,6 @@
language: php
php:
+ - 7
- 5.6
- 5.5
- 5.4
View
3 Validate.php
@@ -583,7 +583,8 @@ function email($email, $options = null)
if ($use_rfc822? Validate::__emailRFC822($email, $options) :
preg_match($regex, $email)) {
if ($check_domain && function_exists('checkdnsrr')) {
- $domain = preg_replace('/[^-a-z.0-9]/i', '', array_pop(explode('@', $email)));
+ $parts = explode('@', $email);
+ $domain = preg_replace('/[^-a-z.0-9]/i', '', array_pop($parts));
if (checkdnsrr($domain, 'MX') || checkdnsrr($domain, 'A')) {
return true;
}
View
2 tests/bug8851.phpt
@@ -3,7 +3,7 @@
--FILE--
<?php
require_once 'Validate.php';
-$validate = & new Validate();
+$validate = new Validate();
$time = "aa:aa";
if (!$validate->date($time,array("format"=>"%h:%i"))) {
echo "Ok";

0 comments on commit a22b5cf

Please sign in to comment.
Something went wrong with that request. Please try again.