Moodle

URLs with _'s are rejected by clean_param(..., PARAM_URL)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Not a bug
  • Affects Version/s: 1.9.1
  • Fix Version/s: 1.9.2
  • Component/s: MNet
  • Labels:
    None
  • Environment:
    Linux, Php v4.3.10
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

To reproduce:
(Turn networking on?)
Goto Admin->Networking->Peers
Under "Add a new host", enter clsa_mnet_a.mroomsonline.com
Moodle (not Mahara)
Press the "Add host" button

Error message: "Invalid URL parameter."

I believe this is being rejected by clean_param in this code (line 82 in admin/mnet/peers.php):
---------
$temp_wwwroot = clean_param($form->wwwroot, PARAM_URL);
if ($temp_wwwroot !== $form->wwwroot) { trigger_error("We now parse the wwwroot with PARAM_URL. Your URL will need to have a valid TLD, etc."); print_error("invalidurl", 'mnet','peers.php'); exit; }
------

(I can connect to the host correctly if I use clsamneta.mroomsonline.com)

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Assignning to Petr...

Show
Eloy Lafuente (stronk7) added a comment - Assignning to Petr...
Hide
Iñaki Arenaza added a comment -

The underscore is not a valid DNS name character (unless a very recent ICANN change on DNS names policy and a correspondent RFC). Valid characters include letters (case insensitive), numbers and dashes. So I'd say the check is right

Saludos. Iñaki.

Show
Iñaki Arenaza added a comment - The underscore is not a valid DNS name character (unless a very recent ICANN change on DNS names policy and a correspondent RFC). Valid characters include letters (case insensitive), numbers and dashes. So I'd say the check is right Saludos. Iñaki.
Hide
Petr Škoda (skodak) added a comment -

yes Iñaki, I agree this is not a bug - thanks

I would recommend to fix the server name instead

Show
Petr Škoda (skodak) added a comment - yes Iñaki, I agree this is not a bug - thanks I would recommend to fix the server name instead

Dates

  • Created:
    Updated:
    Resolved: