summaryrefslogtreecommitdiffstats
path: root/0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-06-27 07:49:00 +0200
committerRemi Collet <fedora@famillecollet.com>2016-06-27 07:49:00 +0200
commit327d7c232c10902ce9ebcdf46400922be74db13c (patch)
tree56bb2a763978d7869c0e5d3ed004461effb1e0b9 /0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch
parentd409dcc7bf59d95291fe5f4e38731b511855d901 (diff)
php-horde-Horde-Date-Parser: drop dep on ereg
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
+