summaryrefslogtreecommitdiffstats
path: root/0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch
diff options
context:
space:
mode:
Diffstat (limited to '0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch')
-rw-r--r--0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch b/0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch
new file mode 100644
index 0000000..75c3672
--- /dev/null
+++ b/0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch
@@ -0,0 +1,58 @@
+From d197a50a3b6d8a74a9f690d75ef595d4b5b6fa27 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Mon, 27 Jun 2016 07:28:40 +0200
+Subject: [PATCH 2/2] drop ereg dep for php 7 in Date_Parser
+
+---
+ .../lib/Horde/Date/Parser/Locale/Pt.php | 28 +++++++++++-----------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Pt.php b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Pt.php
+index 53ab624..77bf7eb 100644
+--- a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Pt.php
++++ b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Pt.php
+@@ -130,14 +130,14 @@ class Horde_Date_Parser_Locale_Pt extends Horde_Date_Parser_Locale_Base
+ public function normalize_special_characters( $str )
+ {
+ # Quotes cleanup
+- $str = ereg_replace( chr(ord("`")), "'", $str ); # `
+- $str = ereg_replace( chr(ord("´")), "'", $str ); # ´
+- $str = ereg_replace( chr(ord("„")), ",", $str ); # „
+- $str = ereg_replace( chr(ord("`")), "'", $str ); # `
+- $str = ereg_replace( chr(ord("´")), "'", $str ); # ´
+- $str = ereg_replace( chr(ord("“")), "\"", $str ); # “
+- $str = ereg_replace( chr(ord("”")), "\"", $str ); # ”
+- $str = ereg_replace( chr(ord("´")), "'", $str ); # ´
++ $str = str_replace( chr(ord("`")), "'", $str ); # `
++ $str = str_replace( chr(ord("´")), "'", $str ); # ´
++ $str = str_replace( chr(ord("„")), ",", $str ); # „
++ $str = str_replace( chr(ord("`")), "'", $str ); # `
++ $str = str_replace( chr(ord("´")), "'", $str ); # ´
++ $str = str_replace( chr(ord("“")), "\"", $str ); # “
++ $str = str_replace( chr(ord("”")), "\"", $str ); # ”
++ $str = str_replace( chr(ord("´")), "'", $str ); # ´
+
+ $unwanted_array = array('Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',
+ 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U',
+@@ -147,12 +147,12 @@ class Horde_Date_Parser_Locale_Pt extends Horde_Date_Parser_Locale_Base
+ $str = strtr( $str, $unwanted_array );
+
+ # Bullets, dashes, and trademarks
+- $str = ereg_replace( chr(149), "&#8226;", $str ); # bullet •
+- $str = ereg_replace( chr(150), "&ndash;", $str ); # en dash
+- $str = ereg_replace( chr(151), "&mdash;", $str ); # em dash
+- $str = ereg_replace( chr(153), "&#8482;", $str ); # trademark
+- $str = ereg_replace( chr(169), "&copy;", $str ); # copyright mark
+- $str = ereg_replace( chr(174), "&reg;", $str ); # registration mark
++ $str = str_replace( chr(149), "&#8226;", $str ); # bullet •
++ $str = str_replace( chr(150), "&ndash;", $str ); # en dash
++ $str = str_replace( chr(151), "&mdash;", $str ); # em dash
++ $str = str_replace( chr(153), "&#8482;", $str ); # trademark
++ $str = str_replace( chr(169), "&copy;", $str ); # copyright mark
++ $str = str_replace( chr(174), "&reg;", $str ); # registration mark
+
+ return $str;
+ }
+--
+2.5.5
+