From 335d3c5c9c0b24ff5e07cd1968236a8dbc4f2c70 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 20 Feb 2017 18:12:46 +0100 Subject: PHP 7 compatibility from Sourceforge #680 --- lib/HTTP/WebDAV/Server.php | 4 ++-- lib/bennu/iCalendar_rfc2445.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/HTTP/WebDAV/Server.php b/lib/HTTP/WebDAV/Server.php index 2d5785d..489d313 100644 --- a/lib/HTTP/WebDAV/Server.php +++ b/lib/HTTP/WebDAV/Server.php @@ -920,7 +920,7 @@ class HTTP_WebDAV_Server if (isset($_SERVER['HTTP_RANGE'])) { // we only support standard 'bytes' range specifications for now - if (ereg('bytes[[:space:]]*=[[:space:]]*(.+)', $_SERVER['HTTP_RANGE'], $matches)) { + if (preg_match('@bytes[[:space:]]*=[[:space:]]*(.+)@', $_SERVER['HTTP_RANGE'], $matches)) { $options['ranges'] = array(); // ranges are comma separated @@ -2180,7 +2180,7 @@ class HTTP_WebDAV_Server // but if opaquelocktokens are used (RFC2518 6.4) // we have to check the format (litmus tests this) if (!strncmp($condition, '$', $condition)) { + if (!preg_match('/^$/', $condition)) { return; } } diff --git a/lib/bennu/iCalendar_rfc2445.php b/lib/bennu/iCalendar_rfc2445.php index e73d863..d6d3ace 100644 --- a/lib/bennu/iCalendar_rfc2445.php +++ b/lib/bennu/iCalendar_rfc2445.php @@ -124,13 +124,13 @@ function rfc2445_is_valid_value($value, $type) { } if($scheme === 'mailto') { - $regexp = '^[a-zA-Z0-9]+[_a-zA-Z0-9\-]*(\.[_a-z0-9\-]+)*@(([0-9a-zA-Z\-]+\.)+[a-zA-Z][0-9a-zA-Z\-]+|([0-9]{1,3}\.){3}[0-9]{1,3})$'; + $regexp = '#^[a-zA-Z0-9]+[_a-zA-Z0-9\-]*(\.[_a-z0-9\-]+)*@(([0-9a-zA-Z\-]+\.)+[a-zA-Z][0-9a-zA-Z\-]+|([0-9]{1,3}\.){3}[0-9]{1,3})$#'; } else { - $regexp = '^//(.+(:.*)?@)?(([0-9a-zA-Z\-]+\.)+[a-zA-Z][0-9a-zA-Z\-]+|([0-9]{1,3}\.){3}[0-9]{1,3})(:[0-9]{1,5})?(/.*)?$'; + $regexp = '#^//(.+(:.*)?@)?(([0-9a-zA-Z\-]+\.)+[a-zA-Z][0-9a-zA-Z\-]+|([0-9]{1,3}\.){3}[0-9]{1,3})(:[0-9]{1,5})?(/.*)?$#'; } - return ereg($regexp, $remain); + return preg_match($regexp, $remain); break; case RFC2445_TYPE_BINARY: -- cgit v1.2.3