X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=CRM%2FUtils%2FString.php;h=1643491496d49a1c352e489abb4245c00591ad29;hb=ea1142867356c1d0859b5a51797e34a3c17f7d39;hp=7e3b8f0d49eb1d0e9030c5767ae5ab817d70cf10;hpb=5bc392e6ce2d040b662ca9abf8a88abf2b0fada4;p=civicrm-core.git diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index 7e3b8f0d49..1643491496 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -717,5 +717,17 @@ class CRM_Utils_String { } } + /** + * Many parts of the codebase have a convention of internally passing around + * HTML-encoded URLs. This effectively means that "&" is replaced by "&" + * (because most other odd characters are %-escaped in URLs; and %-escaped + * strings don't need any extra escaping in HTML). + * + * @param string $url URL with HTML entities + * @return string URL without HTML entities + */ + public static function unstupifyUrl($htmlUrl) { + return str_replace('&', '&', $htmlUrl); + } }