Issue Details (XML | Word | Printable)

Key: MDL-15897
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Petr Skoda
Reporter: Petr Skoda
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

param cleaning improvements

Created: 31/Jul/08 10:14 PM   Updated: 18/Sep/09 11:53 AM
Return to search
Component/s: General
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: Ashley Holman, Martin Dougiamas and Petr Skoda
Security Level: None
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
PARAM_ALPHAEXT - no "/" anymore
PARAM_SAFEPATH - replaces PARAM_ALPHAEXT when "/" needed
PARAM_ALPHANUMEXT

PARAM_TAG - block "<>"and control chars and allow "\"

PARAM_PLAINTEXT like PARAM_TEXT but without multilang support (wiki page names, etc.)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 31/Jul/08 11:41 PM
not sure about PARAM_PLAINTEXT anymore - PARAM_NOTAGS seems like a good candidate instead.

Anyway there is a lot to improve in this area


Petr Skoda added a comment - 01/Aug/08 04:09 AM
also adding is_number() for integers including string form; aliasing PRAM_NUMBER to PARAM_FLOAT and deprecating

Petr Skoda committed 1 file to 'Moodle CVS' - 01/Aug/08 04:10 AM
MDL-15897 param cleaning improvements - see tracker
MODIFY lib/moodlelib.php   Rev. 1.1081    (+86 -50 lines)
Petr Skoda committed 5 files to 'Moodle CVS' - 01/Aug/08 07:03 AM
MDL-15897 deprecated PARAM_CLEANFILE - we now support unicode everywhere
MODIFY question/export_form.php   Rev. 1.6    (+1 -1 lines)
MODIFY admin/roles/manage.php   Rev. 1.63    (+4 -2 lines)
MODIFY lib/simpletest/testmoodlelib.php   Rev. 1.12    (+0 -1 lines)
MODIFY lib/moodlelib.php   Rev. 1.1083    (+9 -33 lines)
MODIFY admin/uploadpicture.php   Rev. 1.11    (+2 -2 lines)
Petr Skoda committed 1 file to 'Moodle CVS' - 01/Aug/08 07:06 AM
MDL-15897 PARAM_SAFEDIR now alias of PARAM_ALPHANUMEXT
MODIFY lib/moodlelib.php   Rev. 1.1084    (+5 -5 lines)
moodler committed 1 file to 'Moodle CVS' - 16/Sep/09 09:52 PM
params MDL-15897 Tidy up PARAM_XXXX defines to use strings instead of numbers, sort alphabetically and segregate the aliases and deprecated definitions

The numbers were used orginally because we planned to use them as bitmasks, but that never happened. Strings are much simpler.
MODIFY lib/moodlelib.php   Rev. 1.1248    (+118 -73 lines)
Martin Dougiamas added a comment - 16/Sep/09 10:23 PM
I tidied up PARAM_XXXX defines to use strings instead of octal numbers, sort alphabetically and segregate the aliases and deprecated definitions.

Also added new definitions for PARAM_AUTH, PARAM_LANG and PARAM_THEME


Ashley Holman committed 2 files to 'Moodle CVS' - 18/Sep/09 11:52 AM
MDL-15897: Changed admin_setting_configtext.validate() check to not treat all strings as custom regex's (since PARAM_* constants are now strings).

Instead require them to have '/' at the beginning and end of the pattern.

The only setting that appears to use a custom regex is scorm/apidebugmask - now updated to contain surrounding slashes.
MODIFY mod/scorm/settings.php   Rev. 1.10    (+3 -3 lines)
MODIFY lib/adminlib.php   Rev. 1.395    (+2 -1 lines)
Ashley Holman added a comment - 18/Sep/09 11:53 AM
I had to update the admin_setting_configtext validation check because it was assuming these constants were integers and treating all strings are regex patterns. The check now requires the regex patterns to be surrounded by slashes, otherwise will treat it as a PARAM constant.