Page MenuHomePhabricator

h1 Tag causes saved page to have missing data (section editing)
Closed, ResolvedPublic

Description

Author: bjkcubed

Description:
It seems using the h1 tag in a wiki page causes issues with editing sections. These results are not seen with 1.6.8 but are seen with
1.7 and 1.8.

Start out with:

Heading 1

<pre>
<h1>test</h1>
</pre>

Heading 2

If you click on Heading 2 to edit that section and then save that page you will get the result below.

Heading 1

<pre>

Heading 2

asdf

In the example above I added the asdf when editing the second section, as you see data is lost. Editing section 1 creates even more
strange results. Starting with the first example and editing section 1 I get the following output.

Heading 1

asdf
<pre>
<h1>test</h1>
</pre>

<h1>test</h1>
</pre>

Heading 2


Version: 1.10.x
Severity: normal
OS: Linux
Platform: Other

Details

Reference
bz7713

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:28 PM
bzimport set Reference to bz7713.
bzimport added a subscriber: Unknown Object (MLST).

bjkcubed wrote:

More server information...

MediaWiki: 1.8.2
PHP: 5.1.6 (apache2handler)
MySQL: 5.0.24a-standard

bjkcubed wrote:

Bug still remains in version 1.9

MediaWiki: 1.9.0
PHP: 5.1.6 (apache2handler)
MySQL: 5.0.24a-standard-log

alan.harder wrote:

I also hit this problem (in version 1.9.2 and 1.9.3) but with h2 tags inside a pre.

It seems that code generating the section [edit] links properly skips over the
h2-inside-pre since it is rendered with the < and > encoded as html entities.
However, the code saving the changes probably sees the raw text and counts this
as a section boundary, thus saving and overwriting the wrong section!

Can confirm with 1.9, but seems fine on 1.10 w/ current trunk.

hempel wrote:

This is still an open issue with 1.10. All you need is a page with multiple
sections, some of which contain <pre> areas. Then go to a section right after
one with a <pre> tag in it, edit it, and add a new section, thus splitting the
section in half. When you save it is almost always corrupted. Just tried this
with 1.10RC1.

hempel wrote:

This is still an open issue with 1.10. All you need is a page with multiple
sections, some of which contain <pre> areas. Then go to a section right after
one with a <pre> tag in it, edit it, and add a new section, thus splitting the
section in half. When you save it is almost always corrupted. Just tried this
with 1.10RC1.

bjkcubed wrote:

Just to confirm that the original example still has the same result on 1.10.0rc1.

lcarsdata wrote:

I have tested with MediaWiki 1.5 through to trunk and can verify that it happens
in all versions of MediaWiki higher than or equal to 1.7 (including trunk) - see
http://www.wikitest.co.uk/1_6/Header_test,
http://www.wikitest.co.uk/1_7/Header_test and
http://www.wikitest.co.uk/SVN/Header_test