TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 01, 2024, 12:11:40 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 167
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 120
  • Total: 120

Question after upgrading to TP 2.0.0 RC1

Started by jernatety, August 31, 2020, 07:06:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

@rjen

Yep, it is caused by the content of the topic...

So now I have an example to play with...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

jernatety

Quote from: @rjen on September 01, 2020, 12:49:49 PM
Thanks,

I understand that it is no longer an issue for you, but it is something that is not right. And I cannot find the same example in my test sites. Maybe it is something in this topic that causes it...

Interesting, that's all of the text in that topic, as you can see it's pretty basic formatting.

@rjen

ok, it is caused by the ending slash in the link at the end of the topic.

[ url=http://www.faithinthefuture.com/]Home | Faith in the Future[/u rl].

Due to that slash the shortenString routine seems to choke...

Tportal.php, line 1617:
if(TPUtil::shortenString($row['body'], $context['TPortal']['frontpage_limit_len']))

This ends up in a preg_match statement that still blows my mind, but I assume tino will know what to do...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

[img]http://archphila.org/wp-content/themes/archdioceseofphiladelphia/images/archdioceselogo.png[/img]

[size=18pt][b]ANNOUNCEMENT FROM THE OFFICE OF CATHOLIC EDUCATION AND FAITH IN THE FUTURE REGARDING FALL INTERSCHOLASTIC SPORTS IN THE 17 ARCHDIOCESAN HIGH SCHOOLS[/b][/size]


If you remove that section does it still break? I think it's finding the wrong closing tag.

@rjen

That section is at the start: removing that while leaving the end part as-is fixes it too...

So two ways to 'repair'

And I agree: it is not shortening the post due to a mix-up in tags...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

lurkalot

Nice work guys, great to see these issues sorted so promptly. O0

tino

If you change following https://github.com/Tinyportal/TinyPortal/blob/dbb2d5fd52fe7fdb87f14a9e2cd7aa99845d874b/TinyPortal/Util.php#L178

To if(strstr($matches[0], $matches[1]) === false) {

It will work ok, I am trying to work out why I did the line before it to get rid of the tag. I think it was for short tags which end in /]

@rjen

That is indeed the fix... I'll submit it..

Running Latest TP on SMF2.1 at: www.fjr-club.nl