1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
Description: Add compatibility for PHP 5.4 using error_reporting(E_ALL)
Author: Dario Minnucci <midget@debian.org>
Last-Update: 2012-04-27
Index: php-validate/Validate-0.8.5/Validate.php
===================================================================
--- php-validate.orig/Validate-0.8.5/Validate.php 2012-04-27 04:06:26.192038726 +0200
+++ php-validate/Validate-0.8.5/Validate.php 2012-04-27 04:14:25.052951330 +0200
@@ -216,7 +216,7 @@
*
* @access private
*/
- function __uriRFC4151($uri)
+ private static function __uriRFC4151($uri)
{
$datevalid = false;
if (preg_match(
@@ -257,7 +257,7 @@
*
* @access public
*/
- function number($number, $options = array())
+ public static function number($number, $options = array())
{
$decimal = $dec_prec = $min = $max = null;
if (is_array($options)) {
@@ -295,7 +295,7 @@
*
* @access private
*/
- function __stringToUtf7($string)
+ private static function __stringToUtf7($string)
{
$return = '';
$utf7 = array(
@@ -373,7 +373,7 @@
*
* @access private
*/
- function __emailRFC822(&$email, &$options)
+ private static function __emailRFC822(&$email, &$options)
{
static $address = null;
static $uncomment = null;
@@ -442,7 +442,7 @@
*
* @return bool True if validating succeeds
*/
- function _fullTLDValidation($email, $options)
+ private static function _fullTLDValidation($email, $options)
{
$validate = array();
if(!empty($options["VALIDATE_ITLD_EMAILS"])) array_push($validate, 'itld');
@@ -481,7 +481,7 @@
*
* @return true or false (Depending on if it validates or if it does not)
*/
- function executeFullEmailValidation($email, $arrayOfTLDs)
+ public static function executeFullEmailValidation($email, $arrayOfTLDs)
{
$emailEnding = explode('.', $email);
$emailEnding = $emailEnding[count($emailEnding)-1];
@@ -516,7 +516,7 @@
*
* @access public
*/
- function email($email, $options = null)
+ public static function email($email, $options = null)
{
$check_domain = false;
$use_rfc822 = false;
@@ -608,7 +608,7 @@
*
* @access public
*/
- function string($string, $options)
+ public static function string($string, $options)
{
$format = null;
$min_length = 0;
@@ -670,7 +670,7 @@
*
* @access public
*/
- function uri($url, $options = null)
+ public static function uri($url, $options = null)
{
$strict = ';/?:@$,';
$domain_check = false;
@@ -746,7 +746,7 @@
*
* @access public
*/
- function date($date, $options)
+ public static function date($date, $options)
{
$max = false;
$min = false;
@@ -929,7 +929,7 @@
* @access private
* @return string
*/
- function _substr(&$date, $num, $opt = false)
+ private static function _substr(&$date, $num, $opt = false)
{
if ($opt && strlen($date) >= $opt && preg_match('/^[0-9]{'.$opt.'}/', $date, $m)) {
$ret = $m[0];
@@ -940,7 +940,7 @@
return $ret;
}
- function _modf($val, $div)
+ private static function _modf($val, $div)
{
if (function_exists('bcmod')) {
return bcmod($val, $div);
@@ -993,7 +993,7 @@
*
* @return int -1 calculated control number is returned
*/
- function _getControlNumber($number, &$weights, $modulo = 10, $subtract = 0, $allow_high = false)
+ private static function _getControlNumber($number, &$weights, $modulo = 10, $subtract = 0, $allow_high = false)
{
// calc sum
$sum = Validate::_multWeights($number, $weights);
@@ -1023,7 +1023,7 @@
*
* @return bool true if valid, false if not
*/
- function _checkControlNumber($number, &$weights, $modulo = 10, $subtract = 0)
+ private static function _checkControlNumber($number, &$weights, $modulo = 10, $subtract = 0)
{
if (strlen($number) < count($weights)) {
return false;
@@ -1060,7 +1060,7 @@
*
* @access public
*/
- function multiple(&$data, &$val_type, $remove = false)
+ public static function multiple(&$data, &$val_type, $remove = false)
{
$keys = array_keys($data);
$valid = array();
@@ -1131,11 +1131,11 @@
*
* @param string $filename file to search for
*
- * @access private
+ * @access public
*
* @return bool true if file exists
*/
- function _includePathFileExists($filename)
+ private static function _includePathFileExists($filename)
{
$paths = explode(":", ini_get("include_path"));
$result = false;
|