Last modified: 2006-04-08 04:46: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 T7344, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 5344 - Forward slashes in arguments break extensions
Forward slashes in arguments break extensions
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.6.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/User:Jit...
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-24 14:50 UTC by Jitse Niesen
Modified: 2006-04-08 04:46 UTC (History)
0 users

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


Attachments
Proposed bug fix (2.61 KB, patch)
2006-03-24 14:53 UTC, Jitse Niesen
Details

Description Jitse Niesen 2006-03-24 14:50:01 UTC
The input

   <ref name="foo/1">bla</ref>

is not recognized as a tag for Cite.php because of the forward slash in the
argument.
Comment 1 Jitse Niesen 2006-03-24 14:53:43 UTC
Created attachment 1461 [details]
Proposed bug fix
Comment 2 Brion Vibber 2006-03-24 21:15:08 UTC
That's not a valid name.
Comment 3 Jitse Niesen 2006-04-04 03:16:01 UTC
So, what are the valid values for the attributes in extension tags? The only
thing I could find was http://meta.wikimedia.org/wiki/MediaWiki_extensions_FAQ
which says that the tags are "XML-style" and that "[t]he value strings have
already had HTML character entities decoded for you", which implies that they
can contain more than alphanumeric characters.

Perhaps I shouldn't have used the Cite.php extension. The problem is not there,
but in the parser. In particular, Parser::extractTagsAndAttribs() does not
recognize any tag whose attribute has a value containing a forward slash,
because the regular expression in line 335 does not match such tags. I guess I
should have said this in the bug report, sorry.
Comment 4 Brion Vibber 2006-04-04 04:23:14 UTC
It has nothing to do with extension tags, just HTML. Please see the specs, they're 
available online.
Comment 5 Jitse Niesen 2006-04-06 05:01:10 UTC
I suppose you mean that the value of 'name' attributes must not contain slashes.
I agree, and I concede that my example in the first comment was badly chosen. 

However, this does not hold for all attributes. For instance, the value of the
'href' attribute in <a href='...'> may most certainly contain slashes. In the
parser test in the patch, I use

   <tag filename='/tmp/bla'></tag>

Here, tag refers to the extension defined in
maintenance/parserTestsParserHook.php . I think that MediaWiki should recognize
this as a parser extension. However, it does not do this, hence the bug report.
Comment 6 Brion Vibber 2006-04-08 04:28:52 UTC
I wish you hadn't been so specific about using <ref name> here!
Reopening.
Comment 7 Brion Vibber 2006-04-08 04:46:15 UTC
Sorry for the wait! Entirely my fault, I should have read 
closer.

Applied on trunk at r13539, and REL1_6 at r13540.

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


Navigation
Links