TinyPortal

Development => Support => Topic started by: Kokoro on January 29, 2023, 01:34:16 AM

Title: Links not working and more
Post by: Kokoro on January 29, 2023, 01:34:16 AM
Link to my forum: http://www.animerpgs.com/
SMF version: 2.1.3
TP version: 2.2.2
Default Forum Language: English
Theme name and version: Windows XP
Browser Name and Version: Firefox 109.0 (64-bit)
Mods installed: Discord Web Hooks (2.0.1), SMFPacks Social Login (2.3.2), Discord Who's Online (1.0.1), Board Sorting Method (1.0.1), Forum Width Setting (1.2), Login Menu Button (2.0), Members Online Today (1.0), Avatars Display Integration (1.5.4), Post as Another Member (1.6), Dice Roller BBcode (2.0), SMF Post Prefix (4.1.0)
Related Error messages: (none)

I checked on the source code of my document and saw all of this.  I have redone the post, and it comes back.  See screenshot for more information.
Title: Re: Links not working and more
Post by: @rjen on January 29, 2023, 07:58:27 AM
Hi, I am not 100% what the issue is, but I suspect that you are seeing that the url's in a bbc articles are broken, after you have changed the article, that was ok at first?

This is an issue that was reported before and caused by a bug in version 2.2.2. that will incorrectly 'parse'  BBC articles after changing them.

This has been fixed in the next version of TinyPortal (2.3.0) which we hope to release soon.

The only workaround in 2.2.2 is to manually fix the broken links and save the article: the first time the link will be parsed correctly, but then chanhing the article will break them again...
Title: Re: Links not working and more
Post by: @rjen on January 29, 2023, 11:31:15 AM
The fix involves fixing two source files..

TParticle.php
line 430

find
}
$article_data[$setting] = $value;
break;


replace
}
// BBC we need to encode quotes
if (TP_SMF21) {
if( ($_REQUEST['tp_article_type'] == 'bbc') && ($setting == 'body') ) {
$value = $smcFunc['htmlspecialchars']($value, ENT_QUOTES);
}
}
$article_data[$setting] = $value;
break;


and

TPortalAdmin.php
line 1009

find
$context['TPortal']['editing_article'] = true;
$context['TPortal']['editarticle']['body'] = $smcFunc['htmlspecialchars']($context['TPortal']['editarticle']['body'], ENT_QUOTES);
$smcFunc['db_free_result']($request);


replace
$context['TPortal']['editing_article'] = true;
if (TP_SMF21) {
if($context['TPortal']['editarticle']['type'] != 'bbc') {
$context['TPortal']['editarticle']['body'] = $smcFunc['htmlspecialchars']($context['TPortal']['editarticle']['body'], ENT_QUOTES);
}
}
else {
$context['TPortal']['editarticle']['body'] = $smcFunc['htmlspecialchars']($context['TPortal']['editarticle']['body'], ENT_QUOTES);
}
$smcFunc['db_free_result']($request);
Title: Re: Links not working and more
Post by: lurkalot on January 29, 2023, 11:55:23 AM
Just curious, as this is only displayed on the front page, would it not be better added to a front page block instead of an article? Or perhaps even a TOP/Upper/Lower/ block and just tell it to only display on the front page.
Title: Re: Links not working and more
Post by: Kokoro on January 29, 2023, 09:15:51 PM
I may just rewrite the article/frontpage as an HTML document instead.
Title: Re: Links not working and more
Post by: @rjen on January 29, 2023, 09:18:23 PM
That will work too