Initial Commit

This commit is contained in:
GiacomoHome
2021-09-17 12:41:45 +02:00
commit 9001e4656e
570 changed files with 31013 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
class Zend_View_Helper_MatchUrl extends Zend_View_Helper_Abstract {
public function MatchUrl($text){
$reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
preg_match_all($reg_exUrl, $text, $matches);
$usedPatterns = array();
foreach($matches[0] as $pattern){
if(!array_key_exists($pattern, $usedPatterns)){
$usedPatterns[$pattern]=true;
$text = str_replace($pattern, '<a href="'.$pattern.'" rel="nofollow" target="_blank" >'.$pattern.'</a>', $text);
}
}
return $text;
}
}