X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FRule.php;h=d58c86a63725a6f44edfb117be75017e1ce6622d;hb=1136a401d9f7f98cca09248ee5216b52200e958c;hp=4c27b896e9a6c3299ec0ce521848dc9dd93ae99d;hpb=03298d98322f2da05e2ab30cb0e2d5b90df47ab3;p=civicrm-core.git diff --git a/CRM/Utils/Rule.php b/CRM/Utils/Rule.php index 4c27b896e9..d58c86a637 100644 --- 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); } @@ -212,7 +216,7 @@ class CRM_Utils_Rule { } /** - * check the validity of the date (in qf format) + * Check the validity of the date (in qf format) * note that only a year is valid, or a mon-year is * also valid in addition to day-mon-year. The date * specified has to be beyond today. (i.e today or later) @@ -305,7 +309,7 @@ class CRM_Utils_Rule { } /** - * check the validity of a date or datetime (timestamp) + * Check the validity of a date or datetime (timestamp) * value which is in YYYYMMDD or YYYYMMDDHHMMSS format * * Uses PHP checkdate() - params are ( int $month, int $day, int $year ) @@ -420,6 +424,15 @@ class CRM_Utils_Rule { $config = CRM_Core_Config::singleton(); + //CRM-14868 + $currencySymbols = CRM_Core_PseudoConstant::get( + 'CRM_Contribute_DAO_Contribution', + 'currency', array( + 'keyColumn' => 'name', + 'labelColumn' => 'symbol' + )); + $value = str_replace($currencySymbols,'',$value); + if ($config->monetaryThousandSeparator) { $mon_thousands_sep = $config->monetaryThousandSeparator; } @@ -540,7 +553,7 @@ class CRM_Utils_Rule { } /** - * see how file rules are written in HTML/QuickForm/file.php + * See how file rules are written in HTML/QuickForm/file.php * Checks to make sure the uploaded file is ascii * * @param array Uploaded file info (from $_FILES) @@ -587,7 +600,7 @@ class CRM_Utils_Rule { } /** - * see how file rules are written in HTML/QuickForm/file.php + * See how file rules are written in HTML/QuickForm/file.php * Checks to make sure the uploaded file is html * * @param array Uploaded file info (from $_FILES) @@ -732,7 +745,7 @@ class CRM_Utils_Rule { } /** - * check the validity of the date (in qf format) + * Check the validity of the date (in qf format) * note that only a year is valid, or a mon-year is * also valid in addition to day-mon-year *