Last modified: 2011-04-21 08:21:28 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 T17705, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15705 - Bug in text selection in Opera in insertTags() (with patch)
Bug in text selection in Opera in insertTags() (with patch)
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
unspecified
All All
: Low normal with 7 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-24 10:42 UTC by Piotr Kubowicz
Modified: 2011-04-21 08:21 UTC (History)
3 users (show)

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


Attachments

Description Piotr Kubowicz 2008-09-24 10:42:02 UTC
There's a bug in insertTags() function causing Opera 9.5x select wrong text when inserted text contains newline characters.

Example:

mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png",
     "speedTip": "FooBar",
     // <nowiki>
     "tagOpen": "foo foo(",
     "tagClose": ")bar\nbar\nbar\nbar",
     "sampleText": "baz baz"};

This bug causes problem on Wiktionary, as buttons inserting multi-line text are in common use there (nearly on every edit creating a new page).

Suggested solution:

Remove

if (window.opera)
  tagClose = tagClose.replace(/\n/g,'');

(terrible browser sniffing BTW) - this helps on Opera 9.5, don't know how it's with previous persions, but I remember the problem with insertTags() at least since the very beginning of Opera 9.x versions. Alternatively, your can change browser sniffing to:

if (is_opera && is_opera_seven)

or something like this. Or, the best way, remove the browser sniffing completely:

http://dev.opera.com/articles/view/a-browser-sniffing-warning-the-trouble/
Comment 1 Piotr Kubowicz 2008-12-03 21:43:22 UTC
For your knowledge: we on Polish Wiktionary have to add a lot of JavaScript to fix this bug - because we are not able to remove two buggy lines from edit.js otherwise.

http://pl.wiktionary.org/wiki/MediaWiki:Common.js/edit.js
Comment 2 Piotr Kubowicz 2010-02-07 11:59:44 UTC
Please note that we are in year 2010 and noone uses Opera 7, so this fix 'if (window.opera)' no longer helps anybody, and makes trouble for all Opera users instead.
Comment 3 DieBuche 2011-04-21 08:21:28 UTC
Fixed in r86603

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


Navigation
Links