Last modified: 2010-05-15 15:37:58 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 T5117, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3117 - ImagePage.php adds linebreaks at the size/mime line
ImagePage.php adds linebreaks at the size/mime line
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.5.x
All All
: Normal normal (vote)
: ---
Assigned To: Brion Vibber
http://commons.wikimedia.org/wiki/Ima...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-11 16:57 UTC by Benjamin West
Modified: 2010-05-15 15:37 UTC (History)
1 user (show)

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


Attachments

Description Benjamin West 2005-08-11 16:57:24 UTC
10:18 < Duesentrieb> the page is generated by ImagePage.php, lines 209 and 233
[snip]
10:42 < mrgenixus> Duesentrieb noticed an error on page
                   http://commons.wikimedia.org/wiki/Image:Wikimania-phase4.pdf
                   with the mime reporting and I thik the problem is that the
                   $wgOut->addwikiText() needs the false parameter in lines
                   IIIII$wgOut->addHTML("<span class=\"fileInfo\"> (");
10:42 < mrgenixus> IIIII$wgOut->addWikiText( $info, false );
10:42 < mrgenixus> IIIII$wgOut->addHTML(")</span>");
10:42 < mrgenixus> oh,
10:42 < mrgenixus> nm
10:42 < mrgenixus> it's already there
10:42 < mrgenixus> but it doesn't work

see 
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/ImagePage.php?view=markup/file
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/OutputPage.php?rev=1.240&only_with_tag=HEAD&view=markup
error seems to be in parser.php, I think
$linestart is passed all the way to parse();
Comment 1 Daniel Kinzler 2005-08-11 17:43:01 UTC
The effect of this can be seen on "Image:" pages for non-images, like this one:
<http://commons.wikimedia.org/wiki/Image:Wikimania-phase4.pdf>: the file-size
and mime-type in the perentecies should be inlined. The message comes from
MediaWiki:Fileinfo, no linebreaks are defined there.

The generated HTML looks like this: 
 <span class="fileInfo"> (<p>622KB, MIME type:
<code>application/pdf</code></p>)</span>
The question is: where do the <p> tags come from? The "newline" parameter of
addWikitext should suppress those, right?
Comment 2 Daniel Kinzler 2005-08-11 17:52:05 UTC
I just installed the current HEAD - seems to work fine. So, the fix (whatever it
was) needs to be backported to 1.5 and applied to the live sites. This is a
little annoying on the commons, etc
Comment 3 Daniel Kinzler 2005-08-11 18:22:03 UTC
Update: I was unable to find a difference between 1.5alpha4 and HEAD that would
explain why it's working now. Avar suggested that this problem may be caused by
html-tidy. This needs some more investigation, i guess...
Comment 4 Daniel Kinzler 2005-08-11 18:58:12 UTC
Ok, I found the reason for this: tidy is applied individually to messages added
via addWikiText(). Tidy inserts <p> tags if there is not block element wrapping
the input. It would be much better to apply tidy only once, see bug #3119.
Comment 5 Brion Vibber 2005-08-12 04:31:08 UTC
The tidy bit is correct behavior; wiki text blocks are blocks, and should be output whole.
Comment 6 Brion Vibber 2005-08-12 04:54:05 UTC
Fix applied to HEAD and REL1_5:
* (bug 3117) Fix display of upload size and type with tidy on
r1=1.108&r2=1.109">http://cvs.defau.lt/cvsweb.cgi/phase3/includes/ImagePage.php.diff?r1=1.108&r2=1.109

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


Navigation
Links