?
avatar beetabonk
beetabonk
12 Mar 2017

Steps to reproduce the issue

create an article with an <hr /> anywhere prior to an <hr class="system-pagebreak" />

Expected result

normal pagination

Actual result

the text between the first <hr /> and the page break is stripped at render

System information (as much as possible)

Joomla! 3.6.5

Additional comments

the cause is the page splitting regular expression in the pagebreak content plugin
plugins/content/pagebreak/pagebreak.php

// Expression to search for.
$regex = '#<hr(.*)class="system-pagebreak"(.*)\/>#iU';

this regex will capture too much. for example the following html will match the pagebreak regex causing two paragraphs to be stripped at render because the first opening <hr will match with .* all the way to the last class="system-pagebreak" />

<hr />
<p>paragraph under first hr tag</p>
<hr />
<p>paragraph under second hr tag</p>
<hr class="system-pagebreak" />

Fix

simply correct the regular expression to use [^>]* instead of .* to contain the match within a single <hr...\> instance.

// Expression to search for.
$regex = '#<hr([^>]*)class="system-pagebreak"([^>]*)\/>#iU';
avatar beetabonk beetabonk - open - 12 Mar 2017
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 Mar 2017
avatar beetabonk beetabonk - change - 12 Mar 2017
Title
`````` in article breaks pagination
in article breaks pagination
avatar beetabonk beetabonk - edited - 12 Mar 2017
avatar beetabonk beetabonk - change - 12 Mar 2017
Title
in article breaks pagination
`````` in article breaks pagination
avatar beetabonk beetabonk - change - 12 Mar 2017
Title
in article breaks pagination
`````` in article breaks pagination
avatar beetabonk beetabonk - edited - 12 Mar 2017
avatar beetabonk beetabonk - change - 12 Mar 2017
Title
hr tag in article breaks pagination
in article breaks pagination
avatar beetabonk beetabonk - edited - 12 Mar 2017
avatar beetabonk beetabonk - change - 12 Mar 2017
Title
`````` in article breaks pagination
hr tag in article breaks pagination
avatar beetabonk beetabonk - change - 12 Mar 2017
Title
in article breaks pagination
hr tag in article breaks pagination
avatar zero-24
zero-24 - comment - 12 Mar 2017

@beetabonk please send you changes as Pull Request agains the staging branch ?

Feel free to ask any questions if you need help please also see here: https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests

avatar beetabonk
beetabonk - comment - 12 Mar 2017

@zero-24 i just added the pull request. did i do something wrong that it does not show up here as well? or should i have not created an issue and only done the pull request? (sorry new to github).

avatar bertmert
bertmert - comment - 12 Mar 2017

@beetabonk
You referenced the wrong issue in your PR #14535

It should be issue "14531" (this one) instead of "14393"

Then a link to the correct PR occurs here automatically.

And yes, if you know already a solution you don't have to open an issue first.

avatar zero-24 zero-24 - change - 12 Mar 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-03-12 16:02:56
Closed_By zero-24
avatar zero-24 zero-24 - close - 12 Mar 2017
avatar zero-24
zero-24 - comment - 12 Mar 2017

@beetabonk i have fixed the wrong reference for you.

The other question @bertmert already answeard. If you have a fix you can directly create a PR. Only if you don't know a solution you should open a issue. Thanks! As we have a PR I'm closing here.

avatar beetabonk
beetabonk - comment - 12 Mar 2017

@zero-24 and @bertmert thanks for the assistance and explanations!

Add a Comment

Login with GitHub to post a comment