Overlib adds extra line

Phoca Gallery - image gallery extension
Gruz
Phoca Enthusiast
Phoca Enthusiast
Posts: 61
Joined: 26 Dec 2008, 19:09
Location: Ukraine
Contact:

Overlib adds extra line

Post by Gruz »

Phoca adds extra <br/> for overlib.
In components/com_phocagallery/views/category/view.html.php at lines
1345
and
1346
there is code

Code: Select all

$this->items[$iS]->description		= str_replace("\n", '<br />', $this->items[$iS]->description);
So if I have an HTML code in the description like this

Code: Select all

<p>Text line 1</p>
<p>Text line 2</p>
Then the code in overlib looks very bad

Code: Select all

<p>Text line 1</p><br/><p>Text line 2</p>
Extra line!

I suggest to add <br/ > only if there is not HTML in the description
Smth. like this

Code: Select all

if (strip_tags($this->items[$iS]->description) == $this->items[$iS]->description) {
	$this->items[$iS]->description		= str_replace("\n", '<br />', $this->items[$iS]->description);
}
Last edited by Gruz on 12 May 2016, 15:36, edited 1 time in total.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47870
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Overlib adds extra line

Post by Jan »

Hi, thank you for the info, I will take a look at it.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47870
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Overlib adds extra line

Post by Jan »

Hi, set in version 4.3.0

Jan
If you find Phoca extensions useful, please support the project
Post Reply