[Mapbender-commits] r9574 - in trunk/mapbender/http: classes geoportal javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Sep 5 07:24:24 PDT 2016


Author: pschmidt
Date: 2016-09-05 07:24:24 -0700 (Mon, 05 Sep 2016)
New Revision: 9574

Modified:
   trunk/mapbender/http/classes/class_owsConstraints.php
   trunk/mapbender/http/geoportal/mod_readCSWResultsDetail.php
   trunk/mapbender/http/geoportal/mod_readOpenSearchResultsDetail.php
   trunk/mapbender/http/javascripts/mod_insertLayerPreviewIntoDb.php
   trunk/mapbender/http/php/mod_featuretypeMetadata.php
   trunk/mapbender/http/php/mod_interfaceWms4Kml.php
   trunk/mapbender/http/php/mod_layerMetadata.php
   trunk/mapbender/http/php/mod_wfsMetadata.php
   trunk/mapbender/http/php/mod_wfs_result.php
Log:
repalce deprecated function eregi_replace with preg_replace

Modified: trunk/mapbender/http/classes/class_owsConstraints.php
===================================================================
--- trunk/mapbender/http/classes/class_owsConstraints.php	2016-09-02 12:36:44 UTC (rev 9573)
+++ trunk/mapbender/http/classes/class_owsConstraints.php	2016-09-05 14:24:24 UTC (rev 9574)
@@ -107,9 +107,9 @@
 	
 	//function to parse urls as links
 	function display_text($string) {
-    		$string = eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
-    		$string = eregi_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
-    		$string = eregi_replace("\n", "<br>", $string);
+    		$string = preg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
+    		$string = preg_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
+    		$string = preg_replace("\n", "<br>", $string);
     		return $string;
 	}  
 	

Modified: trunk/mapbender/http/geoportal/mod_readCSWResultsDetail.php
===================================================================
--- trunk/mapbender/http/geoportal/mod_readCSWResultsDetail.php	2016-09-02 12:36:44 UTC (rev 9573)
+++ trunk/mapbender/http/geoportal/mod_readCSWResultsDetail.php	2016-09-05 14:24:24 UTC (rev 9574)
@@ -136,9 +136,9 @@
 
 
 function display_text($string) {
-    $string = eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
-    $string = eregi_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
-    $string = eregi_replace("\n", "<br>", $string);
+    $string = preg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
+    $string = preg_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
+    $string = preg_replace("\n", "<br>", $string);
     return $string;
 } 
  

Modified: trunk/mapbender/http/geoportal/mod_readOpenSearchResultsDetail.php
===================================================================
--- trunk/mapbender/http/geoportal/mod_readOpenSearchResultsDetail.php	2016-09-02 12:36:44 UTC (rev 9573)
+++ trunk/mapbender/http/geoportal/mod_readOpenSearchResultsDetail.php	2016-09-05 14:24:24 UTC (rev 9574)
@@ -79,9 +79,9 @@
 
 
 function display_text($string) {
-    $string = eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
-    $string = eregi_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
-    $string = eregi_replace("\n", "<br>", $string);
+    $string = preg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
+    $string = preg_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
+    $string = preg_replace("\n", "<br>", $string);
     return $string;
 } 
  

Modified: trunk/mapbender/http/javascripts/mod_insertLayerPreviewIntoDb.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_insertLayerPreviewIntoDb.php	2016-09-02 12:36:44 UTC (rev 9573)
+++ trunk/mapbender/http/javascripts/mod_insertLayerPreviewIntoDb.php	2016-09-05 14:24:24 UTC (rev 9574)
@@ -50,8 +50,8 @@
 	$mapurl = $d[0];
 	$legendurl = $d[1];
 	
-	$mapurl = eregi_replace("(&width=)[0-9]+($|[^0-9])", "\\1".LAYER_PREVIEW_WIDTH."\\2", $mapurl);
-	$mapurl = eregi_replace("(&height=)[0-9]+($|[^0-9])", "\\1".LAYER_PREVIEW_HEIGHT."\\2", $mapurl);
+	$mapurl = preg_replace("(&width=)[0-9]+($|[^0-9])", "\\1".LAYER_PREVIEW_WIDTH."\\2", $mapurl);
+	$mapurl = preg_replace("(&height=)[0-9]+($|[^0-9])", "\\1".LAYER_PREVIEW_HEIGHT."\\2", $mapurl);
 		
 	$adm = new administration();
 	$layer_id = Mapbender::session()->get("layer_preview");

Modified: trunk/mapbender/http/php/mod_featuretypeMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_featuretypeMetadata.php	2016-09-02 12:36:44 UTC (rev 9573)
+++ trunk/mapbender/http/php/mod_featuretypeMetadata.php	2016-09-05 14:24:24 UTC (rev 9574)
@@ -20,9 +20,9 @@
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 
 function display_text($string) {
-    $string = eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
-    $string = eregi_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
-    $string = eregi_replace("\n", "<br>", $string);
+    $string = preg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
+    $string = preg_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
+    $string = preg_replace("\n", "<br>", $string);
     return $string;
 }  
 

Modified: trunk/mapbender/http/php/mod_interfaceWms4Kml.php
===================================================================
--- trunk/mapbender/http/php/mod_interfaceWms4Kml.php	2016-09-02 12:36:44 UTC (rev 9573)
+++ trunk/mapbender/http/php/mod_interfaceWms4Kml.php	2016-09-05 14:24:24 UTC (rev 9574)
@@ -42,7 +42,7 @@
 }
 $admin = new administration();
 $getmapurl = $admin->checkURL($rowKML['wms_getmap']);
-$getmapurl = eregi_replace("&","&", $getmapurl);
+$getmapurl = preg_replace("&","&", $getmapurl);
 //exchange normal url with owsproxyurl
 $sessionId = session_id();
 if ($rowKML['wms_owsproxy'] <> '' && $rowKML['wms_owsproxy'] <> NULL) {

Modified: trunk/mapbender/http/php/mod_layerMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_layerMetadata.php	2016-09-02 12:36:44 UTC (rev 9573)
+++ trunk/mapbender/http/php/mod_layerMetadata.php	2016-09-05 14:24:24 UTC (rev 9574)
@@ -27,9 +27,9 @@
 $layer_name = urldecode($_GET['name']); 
 
 function display_text($string) {
-    $string = mb_eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/{}]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
-    $string = mb_eregi_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
-    $string = mb_eregi_replace("\n", "<br>", $string);
+    $string = mb_preg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/{}]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
+    $string = mb_preg_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
+    $string = mb_preg_replace("\n", "<br>", $string);
     return $string;
 }  
 
@@ -47,7 +47,7 @@
 
 //function to generate temporal kml-file
 function generateKML($kml_id,$resdir,$getmapurl,$wmsversion,$layername,$layertitle,$north,$south,$east,$west){
-$getmapurl = eregi_replace("&","&", $getmapurl);
+$getmapurl = preg_replace("&","&", $getmapurl);
 //$kml_id=md5(uniqid(rand(), true));
 if($h = fopen($resdir."/".$kml_id.".kml","w+")){
 //					$content = $text .chr(13).chr(10); //example for linefeeds

Modified: trunk/mapbender/http/php/mod_wfsMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_wfsMetadata.php	2016-09-02 12:36:44 UTC (rev 9573)
+++ trunk/mapbender/http/php/mod_wfsMetadata.php	2016-09-05 14:24:24 UTC (rev 9574)
@@ -21,9 +21,9 @@
 db_select_db(DB,$con);
 
 function display_text($string) {
-    $string = eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
-    $string = eregi_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
-    $string = eregi_replace("\n", "<br>", $string);
+    $string = preg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
+    $string = preg_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
+    $string = preg_replace("\n", "<br>", $string);
     return $string;
 }  
 

Modified: trunk/mapbender/http/php/mod_wfs_result.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_result.php	2016-09-02 12:36:44 UTC (rev 9573)
+++ trunk/mapbender/http/php/mod_wfs_result.php	2016-09-05 14:24:24 UTC (rev 9574)
@@ -91,7 +91,7 @@
 			$replacement = "\\1<And>\\2<ogc:PropertyIsEqualTo><ogc:PropertyName>" . 
 				$ns . $element_name . "</ogc:PropertyName><ogc:Literal>" . $user . 
 				"</ogc:Literal></ogc:PropertyIsEqualTo></And>\\3"; 
-			$filter = eregi_replace($pattern, $replacement, $filter);
+			$filter = preg_replace($pattern, $replacement, $filter);
 		}
 	}
 	return $filter;



More information about the Mapbender_commits mailing list