ProfessionalWiki / ProfessionalWiki/Maps

Improper handling of UTF-8 in MapEditor code

Open
#18 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Special:MapEditor
Dominant language
JavaScript
Stars
78
Forks
65
Avg merge
9h 17m
Merged PRs (30d)
6

Description

Import from https://bugzilla.wikimedia.org/show_bug.cgi?id=42620

sprintf() used in the code for Special:MapEditor (now moved to Maps/includes/editor/EditorHtml.php) doesn't handle UTF-8 properly.

Seems to me that this problem causes "Uncaught SyntaxError: Unexpected token ILLEGAL" to appear in the console when using the googlemapsEditor forminput in http://openurbandev.com/index.php?title=Special:FormEdit/Address/Home
and hence on saving the page weird things happen like redirection to Homepage

Also the coding styles are not followed here.

see http://www.php.net/manual/en/function.sprintf.php#86304

-- Nischay Nahata 2012-12-02 11:02:09 UTC

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting Maps/includes/editor/EditorHtml.php, especially the sprintf() calls that generate the googlemapsEditor output, and reproduce the Unexpected token ILLEGAL error with UTF-8 input. The work is done when UTF-8 content no longer produces invalid JavaScript or the reported save redirect behavior, while the touched code follows the stated coding style.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.