Skip to content

Commit

Permalink
New param type: PARAM_NUMBER, for floating point numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhunt committed Dec 22, 2006
1 parent 77ed3ba commit 9dae915
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/moodlelib.php
Expand Up @@ -115,6 +115,11 @@
*/
define('PARAM_INTEGER', 0x0002);

/**
* PARAM_NUMBER - a real/floating point number.
*/
define('PARAM_NUMBER', 0x000a);

/**
* PARAM_ALPHA - contains only english letters.
*/
Expand Down Expand Up @@ -363,6 +368,9 @@ function clean_param($param, $type) {
case PARAM_INT:
return (int)$param; // Convert to integer

case PARAM_NUMBER:
return (float)$param; // Convert to integer

case PARAM_ALPHA: // Remove everything not a-z
return eregi_replace('[^a-zA-Z]', '', $param);

Expand Down

0 comments on commit 9dae915

Please sign in to comment.