RSS

LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / General / Problems / Problem with Upper Case Calendar Name
Posted:  21 Feb 2016 10:54
I installed LuxCal for the first time and ran into a problem.  I named my first calendar with my initials in caps "MCQ".  The installation creates a calendar URL with a parameter of '?cal=MCQ'  When I try to use this URL it fails and I get an error logged that says:

2016.02.21 00:30:29 Script: /webcal/index.php - Access denied. Invalid GET variable (cal=MCQ)

I looked in toolbox.php and founds the validVars() function:

//Validate index.php vars
function validVars() {
    $passed = true;
    foreach ($_GET as $key => $value) {
        switch ($key) {
        case 'lc': $passed = preg_match('~^1?$~',$value); break;
        case 'cal': $passed = preg_match('~^[a-zd]{1,20}?$~',$value); break;

I changed this line and added a match for upper case as well as lower case and that looks like it fixed the problem:

case 'cal': $passed = preg_match('~^[a-zA-Zd]{1,20}?$~',$value); break;

Perhaps you can add this change to the next version so my fix isn't overwritten by an upgrade?
Posted:  21 Feb 2016 23:48
Hi Mike,

Done.
In the next calendar version, when creating new calendars, the calendar name (ID) in the name/title pairs may now contain up to 20 of the following characters: a-z, A-Z, 0-9 and _ (underscore).
Roel