aboutsummaryrefslogtreecommitdiff
path: root/src/phinde/Helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/phinde/Helper.php')
-rw-r--r--src/phinde/Helper.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/phinde/Helper.php b/src/phinde/Helper.php
index aeb8ba5..d22b9c8 100644
--- a/src/phinde/Helper.php
+++ b/src/phinde/Helper.php
@@ -3,6 +3,20 @@ namespace phinde;
class Helper
{
+ public static function rewriteUrl($url)
+ {
+ if (!isset($GLOBALS['phinde']['urlRewrites'])
+ || count($GLOBALS['phinde']['urlRewrites']) == 0
+ ) {
+ return $url;
+ }
+
+ foreach ($GLOBALS['phinde']['urlRewrites'] as $pattern => $replacement) {
+ $url = preg_replace('#' . $pattern . '#', $replacement, $url);
+ }
+ return $url;
+ }
+
public static function isUrlAllowed($url)
{
$urlDomain = parse_url($url, PHP_URL_HOST);