summaryrefslogtreecommitdiffstats
path: root/0002-drop-ereg-dep-for-php-7-in-Date_Parser.patch
blob: 75c367258cb7eab9cde429cee0ebc74b89573d28 (plain)
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
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