Last modified: 2014-02-14 03:08:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T53563, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51563 - jqueryMsg should not throw on input similar to external link syntax (whitespace in input ([ $1 $2 ] causes exceptions, [$1 $2] works)
jqueryMsg should not throw on input similar to external link syntax (whitespa...
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.23.0
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n, javascript
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-17 18:46 UTC by Helder
Modified: 2014-02-14 03:08 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Helder 2013-07-17 18:46:00 UTC
After sending feedback from
https://pt.wikipedia.org/w/index.php?oldid=36419116&veaction=edit&uselang=pt-br&debug=1
we always get this error:
------------------------------------------------------------------------------
feedback-thanks: Parse error at position 52 in input: Obrigado! O seu comentário foi adicionado à página "[ $2 $1 ]".
------------------------------------------------------------------------------
Comment 1 Helder 2013-07-17 19:05:39 UTC
I defined a breakpoint to the line
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/1de5cb96285704977b882ddef739a55cecceb95e/resources%2Fmediawiki%2Fmediawiki.jqueryMsg.js#L824
and reloaded the page
https://pt.wikipedia.org/w/index.php?oldid=36419116&veaction=edit&uselang=pt-br&debug=1
After the VE is loaded, I clicked on "BETA" and then on "Deixar um comentário" and immediatelly got the error.

The Stack Trace was like this:

mw.jqueryMsg.parser.wikiTextToAst (mediawiki.jqueryMsg.js:824)
mw.jqueryMsg.parser.getAst (mediawiki.jqueryMsg.js:260)
mw.jqueryMsg.parser.parse (mediawiki.jqueryMsg.js:244)
(anonymous function) (mediawiki.jqueryMsg.js:116)
(anonymous function) (mediawiki.jqueryMsg.js:197)
mw.Feedback.setup (mediawiki.feedback.js:125)
mw.Feedback (mediawiki.feedback.js:66)
ve.init.mw.ViewPageTarget.onToolbarFeedbackToolClick (ve.init.mw.ViewPageTarget.js:786)
proxy (load.php?debug=true&lang=pt-br&modules=jquery%2Cme…=scripts&skin=vector&version=20130627T155106Z:775)
jQuery.event.dispatch (load.php?debug=true&lang=pt-br&modules=jquery%2Cme…scripts&skin=vector&version=20130627T155106Z:3058)
elemData.handle.eventHandle (load.php?debug=true&lang=pt-br&modules=jquery%2Cme…scripts&skin=vector&version=20130627T155106Z:2676)

Also, I typed "result" in the console and got:
["CONCAT", "Obrigado! O seu comentário foi adicionado à página ""]

Notice the current text of
https://translatewiki.net/wiki/MediaWiki:Feedback-thanks/pt-br
is this:
'Obrigado! O seu comentário foi adicionado à página "[ $2  $1 ]".'
Comment 2 Helder 2013-08-30 12:28:19 UTC
I'm still getting the "feedback-thanks: Parse error at position 52 in input: Obrigado! O seu comentário foi adicionado à página "[ $2  $1 ]"." message when I try to post a feedback.
Comment 3 Bartosz Dziewoński 2014-02-13 16:06:15 UTC
This particular problem was caused by the additional spaces, which the JavaScript message parser (mediawiki.jqueryMsg) apparently doesn't grok.

I adjusted the message for now.
Comment 4 Matthew Flaschen 2014-02-13 23:24:20 UTC
They shouldn't throw (though that does tend to be what happens with jqueryMsg).  However, neither:

[ http://example.com Example ]

[ http://example.com Example]

are treated as a text external link on the server.  They both just parse the URL as a bare URL (it does accept a space before the end bracket).

So this bug only shows up when a broken message is used.
Comment 5 Gerrit Notification Bot 2014-02-14 00:38:49 UTC
Change 113307 had a related patch set uploaded by Bartosz Dziewoński:
mediawiki.jqueryMsg: Don't throw parse errors in the user's face

https://gerrit.wikimedia.org/r/113307
Comment 6 Bartosz Dziewoński 2014-02-14 00:39:49 UTC
The above patch sorta kinda addresses this by hiding the user-visible error messages.
Comment 7 Matthew Flaschen 2014-02-14 03:08:25 UTC
(In reply to Bartosz Dziewoński from comment #6)
> The above patch sorta kinda addresses this by hiding the user-visible error
> messages.

Only very indirectly, so I'd prefer not to have it connected to this bug.  It still isn't handling it the same as the server.

Also, marking this as low.  The correct (at least so far as the server is correct) behavior for that input is for:

mw.message( 'feedback-thanks', 'Example', 'http://example.com' ).parse()

to give:

[ <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>  Example ]

Note those bracket are part of the server's actual output.  I don't think anyone really wants that.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links