From: skodak Date: Fri, 30 Jun 2006 13:46:25 +0000 (+0000) Subject: slashargument fix for healthcenter, better diagnostic messages; renamed file.php... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6544f8d896e92561ff7c917ed045e8b79050235e;p=moodle.git slashargument fix for healthcenter, better diagnostic messages; renamed file.php/pic.jpg option to file.php/1/pic.jpg because the course number is mandatory; merged from MOODLE_16_STABLE --- diff --git a/admin/configvars.php b/admin/configvars.php index 6db0b24389..59087ccee8 100644 --- a/admin/configvars.php +++ b/admin/configvars.php @@ -157,8 +157,8 @@ class configvarrss extends configvar { /// slasharguments unset($options); - $options[0] = "file.php?file=/pic.jpg"; - $options[1] = "file.php/pic.jpg"; + $options[0] = "file.php?file=/1/pic.jpg"; + $options[1] = "file.php/1/pic.jpg"; $operatingsystem['slasharguments'] = new configvar (get_string('configslasharguments', 'admin'), choose_from_menu ($options, 'slasharguments', $config->slasharguments, '', '', '', true) ); diff --git a/admin/health.php b/admin/health.php index d4a50de80d..e0ef7cab05 100644 --- a/admin/health.php +++ b/admin/health.php @@ -7,8 +7,7 @@ define('SEVERITY_SIGNIFICANT', 'significant'); define('SEVERITY_CRITICAL', 'critical'); - $resetsesserrorcounter = optional_param('resetsesserrorcounter', 0, PARAM_BOOL); - $solution = optional_param('solution', 0, PARAM_SAFEDIR); //in fact it is class name alhanumeric and _ + $solution = optional_param('solution', 0, PARAM_SAFEDIR); //in fact it is class name alhanumeric and _ require_login(); if (!isadmin()) { @@ -423,7 +422,7 @@ class problem_000010 extends problem_base { $desc .= '
  • slasharguments are enabled in Moodle configuration
  • '; } if ($this->status() == -1) { - $desc .= '
  • can not run automatic test, you can verify it here
  • '; + $desc .= '
  • can not run automatic test, you can verify it here manually
  • '; } else if ($this->status() == 0) { $desc .= '
  • slashargument test failed, please check server configuration
  • '; } else { @@ -501,7 +500,7 @@ class problem_000011 extends problem_base { } function solution() { global $CFG; - if (!empty($resetsesserrorcounter)) { + if (optional_param('resetsesserrorcounter', 0, PARAM_BOOL)) { if (get_field('config', 'name', 'name', 'session_error_counter')) { delete_records('config', 'name', 'session_error_counter'); } diff --git a/filter/algebra/algebradebug.php b/filter/algebra/algebradebug.php index 3077f51d15..6ae4967107 100644 --- a/filter/algebra/algebradebug.php +++ b/filter/algebra/algebradebug.php @@ -302,9 +302,9 @@ function slasharguments($texexp, $md5) { $image = tex2image($texexp,$md5,true); echo "

    If the following image displays correctly, set your "; echo "Administration->Configuration->Variables "; - echo "setting for slasharguments to file.php/pic.jpg: "; + echo "setting for slasharguments to file.php/1/pic.jpg: "; echo "

    \n"; - echo "

    Otherwise set it to file.php?file=pic.jpg "; + echo "

    Otherwise set it to file.php?file=/1/pic.jpg "; echo "It should display correctly as "; echo "

    \n"; echo "

    If neither equation image displays correctly, please seek "; diff --git a/filter/tex/texdebug.php b/filter/tex/texdebug.php index 6c3973638f..d6e41ae49f 100644 --- a/filter/tex/texdebug.php +++ b/filter/tex/texdebug.php @@ -178,9 +178,9 @@ $image = tex2image($texexp,true); echo "

    If the following image displays correctly, set your "; echo "Administration->Configuration->Variables "; - echo "setting for slasharguments to file.php/pic.jpg: "; + echo "setting for slasharguments to file.php/1/pic.jpg: "; echo "

    \n"; - echo "

    Otherwise set it to file.php?file=pic.jpg "; + echo "

    Otherwise set it to file.php?file=/1/pic.jpg "; echo "It should display correctly as "; echo "

    \n"; echo "

    If neither equation image displays correctly, please seek "; diff --git a/lib/weblib.php b/lib/weblib.php index f17b775c48..da51dd0a4e 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1096,7 +1096,7 @@ function get_file_argument($scriptname) { if (!strpos($path_info, $scriptname)) { $relativepath = clean_param(rawurldecode($path_info), PARAM_PATH); if ($relativepath === '/testslasharguments') { - echo 'test 1: Slasharguments test passed.'; //indicate ok for health center + echo 'test 1: Slasharguments test passed. Server confguration is compatible with file.php/1/pic.jpg slashargument setting.'; //indicate ok for health center die; } } @@ -1110,7 +1110,7 @@ function get_file_argument($scriptname) { $path_info = strip_querystring($arr[1]); $relativepath = clean_param(rawurldecode($path_info), PARAM_PATH); if ($relativepath === '/testslasharguments') { - echo 'test 2:Slasharguments test passed (compatibility hack).'; //indicate ok for health center + echo 'test 2:Slasharguments test passed (compatibility hack). Server confguration may be compatible with file.php/1/pic.jpg slashargument setting'; //indicate ok for health center die; } }