Last modified: 2014-08-26 12:25:15 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 T70451, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68451 - Translation: <tvar> should accept multi-line content
Translation: <tvar> should accept multi-line content
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Translate (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-23 17:04 UTC by Helder
Modified: 2014-08-26 12:25 UTC (History)
3 users (show)

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


Attachments

Description Helder 2014-07-23 17:04:16 UTC
Currently, the extension uses this regex:
	$re = '~<tvar\|([^>]+)>(.*?)</>~u';
when parsing the content of "tvar"[1], but this do not work if the content spans multiple lines, as in
https://www.mediawiki.org/w/index.php?title=Thumbnail_style_update&diff=1074482&oldid=1074458

I believe it would work if we set PCRE_DOTALL for this regex (if that is the case, this is an easy bug to fix, so I'm adding the appropriated keyword to the bug report).

[1] https://github.com/wikimedia/mediawiki-extensions-Translate/blob/bdd2d990d3785360a0377d32f32188396bbe8b45/tag/TPSection.php#L42-L52
Comment 1 Niklas Laxström 2014-07-23 17:42:04 UTC
PCRE_DOTALL is the suffix 's'. http://fi2.php.net/manual/en/reference.pcre.pattern.modifiers.php

Please add a test case if submitting a patch.

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


Navigation
Links