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 4c27b896e9a6c3299ec0ce521848dc9dd93ae99d..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) {
* @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);
}
return (bool) filter_var($url, FILTER_VALIDATE_URL);
}
@@
-212,7
+216,7
@@
class CRM_Utils_Rule {
}
/**
}
/**
- *
c
heck the validity of the date (in qf format)
+ *
C
heck 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)
* 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 {
}
/**
}
/**
- *
c
heck the validity of a date or datetime (timestamp)
+ *
C
heck 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 )
* 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();
$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;
}
if ($config->monetaryThousandSeparator) {
$mon_thousands_sep = $config->monetaryThousandSeparator;
}
@@
-540,7
+553,7
@@
class CRM_Utils_Rule {
}
/**
}
/**
- *
s
ee how file rules are written in HTML/QuickForm/file.php
+ *
S
ee 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)
* Checks to make sure the uploaded file is ascii
*
* @param array Uploaded file info (from $_FILES)
@@
-587,7
+600,7
@@
class CRM_Utils_Rule {
}
/**
}
/**
- *
s
ee how file rules are written in HTML/QuickForm/file.php
+ *
S
ee 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)
* Checks to make sure the uploaded file is html
*
* @param array Uploaded file info (from $_FILES)
@@
-732,7
+745,7
@@
class CRM_Utils_Rule {
}
/**
}
/**
- *
c
heck the validity of the date (in qf format)
+ *
C
heck 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
*
* note that only a year is valid, or a mon-year is
* also valid in addition to day-mon-year
*