dereuromark 8 years ago
parent
commit
4f491c8c50
2 changed files with 12 additions and 1 deletions
  1. 1 1
      src/Utility/Utility.php
  2. 11 0
      src/View/Helper/TextHelper.php

+ 1 - 1
src/Utility/Utility.php

@@ -216,7 +216,7 @@ class Utility {
 	}
 
 	/**
-	 * Remove http:// or other protocols from the link
+	 * Removes http:// or other protocols from the link.
 	 *
 	 * @param string $url
 	 * @param array $protocols Defaults to http and https. Pass empty array for all.

+ 11 - 0
src/View/Helper/TextHelper.php

@@ -83,6 +83,17 @@ class TextHelper extends CakeTextHelper {
 	}
 
 	/**
+	 * Removes http:// or other protocols from the link.
+	 *
+	 * @param string $url
+	 * @param array $protocols Defaults to http and https. Pass empty array for all.
+	 * @return string strippedUrl
+	 */
+	public function stripProtocol($url, $protocols = ['http', 'https']) {
+		return Utility::stripProtocol($url, $protocols);
+	}
+
+	/**
 	 * Transforming int values into ordinal numbers (1st, 3rd, ...).
 	 * When using HTML, you can use <sup>, as well.
 	 *