projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
CRM-15598 - Allow relative URL's for Link custom fields
[civicrm-core.git]
/
CRM
/
Utils
/
Rule.php
diff --git
a/CRM/Utils/Rule.php
b/CRM/Utils/Rule.php
index a4111ce3ea27093876adb733193631e7f2e7b903..d58c86a63725a6f44edfb117be75017e1ce6622d 100644
(file)
--- a/
CRM/Utils/Rule.php
+++ b/
CRM/Utils/Rule.php
@@
-153,6
+153,10
@@
class CRM_Utils_Rule {
* @return bool
*/
static function url($url) {
+ if (preg_match('/^\//', $url)) {
+ // allow relative URL's (CRM-15598)
+ $url = 'http://' . $_SERVER['HTTP_HOST'] . $url;
+ }
return (bool) filter_var($url, FILTER_VALIDATE_URL);
}