Moodle

weblib.php breaks upper-case hex Numeric Character References

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8
  • Fix Version/s: 1.8
  • Component/s: Course
  • Labels:
    None
  • Environment:
    Moodle 1.8, PHP 5.1.4, PostgreSQL 8.1.4 on RedHat Linux.
  • Database:
    PostgreSQL
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE

Description

Function format_string in lib/weblib.php has a regexp for converting lone ampersands to & It is designed to ignore HTML entities and NCR's, if these are used to represent foreign characters, but it does not ignore hex NCR's where the hex alpha characters are upper case. However, it appears that hex NCR's are allowed to be case-insensitive (http://www.w3.org/International/questions/qa-escapes).

I attach a patch to allow the regexp to ignore hex NCR's with upper case alpha characters, and hope that this is of use.

Activity

Hide
Gareth Morgan added a comment -

P.s. in the above description, instead of the sentence "if these are used to represent foreign characters"

please substitute "these are used to represent foreign characters for example".

I was not meaning to imply conditional behaviour.

Show
Gareth Morgan added a comment - P.s. in the above description, instead of the sentence "if these are used to represent foreign characters" please substitute "these are used to represent foreign characters for example". I was not meaning to imply conditional behaviour.
Hide
Petr Škoda (skodak) added a comment -

thanks for the patch, committed into cvs

Show
Petr Škoda (skodak) added a comment - thanks for the patch, committed into cvs

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: