Moodle

PARAM_URL is too strict - only official TLD accepted

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8
  • Fix Version/s: 1.8.4, 1.9
  • Component/s: General
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

The problem is that moodle is often run in intranets or on local hosts and this is breaking it in several places.
I propose to make this less strict and allow and safely looking urls...

I suppose Martín or somebody else from Catalyts implemented the PARAM_URL originally, right?

Activity

Hide
Petr Škoda (skodak) added a comment -

maybe add new PARAM_TLD_URL

Show
Petr Škoda (skodak) added a comment - maybe add new PARAM_TLD_URL
Hide
Martín Langhoff added a comment -

Yes, we carry the blame for this one, but it's an imported validation routing (not written by catalyst ). I agree it's a bug that it requires TLD.

If we add PARAM_TLD_URL it means that some things won't work in an intranet, and it'll be "hardcoded". Perhaps we could make PARAM_URL be controlled by a config option ("require tld in urls"). that people in intranets can disable. So all the checks for PARAM_URL become a bit more lax if it is set to "no".

Show
Martín Langhoff added a comment - Yes, we carry the blame for this one, but it's an imported validation routing (not written by catalyst ). I agree it's a bug that it requires TLD. If we add PARAM_TLD_URL it means that some things won't work in an intranet, and it'll be "hardcoded". Perhaps we could make PARAM_URL be controlled by a config option ("require tld in urls"). that people in intranets can disable. So all the checks for PARAM_URL become a bit more lax if it is set to "no".
Hide
Petr Škoda (skodak) added a comment -

Fixed in cvs.

I have uncommented original regex code for domains in the validation library and improved inline docs in moodlelib.php for PARAM_URL

Show
Petr Škoda (skodak) added a comment - Fixed in cvs. I have uncommented original regex code for domains in the validation library and improved inline docs in moodlelib.php for PARAM_URL

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: