Skip to content

Commit

Permalink
dev-php/PEAR-Validate: Revbump for EAPI, eclass changes and add tests
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.24, Repoman-2.3.6
  • Loading branch information
Brian Evans committed Feb 14, 2018
1 parent ae338f7 commit 852388e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dev-php/PEAR-Validate/PEAR-Validate-0.8.5-r1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit php-pear-r2

KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"

DESCRIPTION="Validation class"
LICENSE="BSD"
SLOT="0"
IUSE="minimal test"

DEPEND="test? ( dev-php/PEAR-PEAR dev-php/PEAR-Date )"
RDEPEND="!minimal? ( dev-php/PEAR-Date )"
PATCHES=( "${FILESDIR}/0.8.5-fix-test-php7.patch" )
HTML_DOCS=( docs/Example_Locale.php docs/sample_multiple.php )

src_test() {
peardev run-tests tests || die
}
19 changes: 19 additions & 0 deletions dev-php/PEAR-Validate/files/0.8.5-fix-test-php7.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
From a22b5cf2c7e4b4cf366c311150721961d9b456ea Mon Sep 17 00:00:00 2001
From: Christian Weiske <[email protected]>
Date: Thu, 16 Jul 2015 00:38:55 +0200
Subject: [PATCH] Make tests run on PHP 7

diff --git a/Validate.php b/Validate.php
index a8f621c..ea6cfa7 100644
--- a/Validate.php
+++ b/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;
}

0 comments on commit 852388e

Please sign in to comment.