Révision 81b16cc2
Ajouté par Assos Assos il y a environ 7 ans
drupal7/sites/all/modules/webform_validation/webform_validation.install | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* webform_validation installation file
|
|
5 |
* Webform_validation installation file.
|
|
6 | 6 |
*/ |
7 | 7 |
|
8 | 8 |
/** |
... | ... | |
123 | 123 |
} |
124 | 124 |
|
125 | 125 |
/** |
126 |
* Helper function: update numeric validator range to new syntax |
|
126 |
* Helper function: update numeric validator range to new syntax.
|
|
127 | 127 |
*/ |
128 | 128 |
function _webform_validation_update_range_syntax($range) { |
129 |
// no longer use "0" as indicator for no validation. This should be an empty string
|
|
129 |
// No longer use "0" as indicator for no validation. This should be an empty string.
|
|
130 | 130 |
if ($range === "0") { |
131 | 131 |
return ""; |
132 | 132 |
} |
133 | 133 |
|
134 |
// replace "0-VAL" with "|VAL" as indicator for less than or equal to
|
|
134 |
// Replace "0-VAL" with "|VAL" as indicator for less than or equal to.
|
|
135 | 135 |
if (preg_match('/^0 ?-/', $range)) { |
136 | 136 |
$range_arr = explode('-', $range); |
137 | 137 |
$range_end = $range_arr[1]; |
138 | 138 |
return "|" . trim($range_end); |
139 | 139 |
} |
140 | 140 |
|
141 |
// replace "-" as separator between range values in favor of "|"
|
|
141 |
// Replace "-" as separator between range values in favor of "|".
|
|
142 | 142 |
$range = str_replace("-", "|", $range); |
143 | 143 |
return $range; |
144 | 144 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules