Moodle

Apostrophe in surname prevents user updating profile

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.6.2
  • Fix Version/s: 1.6.4, 1.7.1, 1.8
  • Component/s: Authentication
  • Labels:
    None
  • Environment:
    SUSE Linux Enterprise Server 9, Apache 2.0.49, MySQL 4.1.20, PHP 4.3.4
    (database not yet migrated to unicode due to contrib modules)
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_16_STABLE
  • Fixed Branches:
    MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE

Description

If a user (authenticated against our Novell eDirectory LDAP server) with an apostrophe in their surname (e.g. O'Connor) attempts to update their own profile they get the error e.g. 'Could not update the user record (8481)'. (With PHP error reporting on: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Connor'...etc.)

I get the above if I'm logged in as the user, but when logged in as an admin there's no problem updating the profile.

Also, if I escape the apostrophe with a backslash the user is then able to update their profile once only (although the backslash is displayed in certain places as in bug report MDL-6266) but then the surname reverts to its original unescaped form and the problem is back.

Issue Links

Activity

Hide
Iñaki Arenaza added a comment -

The attached patch should fix the issue.

Saludos. Iñaki.

Show
Iñaki Arenaza added a comment - The attached patch should fix the issue. Saludos. Iñaki.
Hide
Tony Butler added a comment -

Thanks Inaki - that works great

Cheers,

Tony

Show
Tony Butler added a comment - Thanks Inaki - that works great Cheers, Tony
Hide
Petr Škoda (skodak) added a comment -

Fixed in cvs, thanks for the report and the patch!

Show
Petr Škoda (skodak) added a comment - Fixed in cvs, thanks for the report and the patch!

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: