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

Recent

Welcome to TinyPortal. Please login or sign up.

October 12, 2024, 11:36:21 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,395
  • Total Topics: 21,244
  • Online today: 215
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 36
  • Total: 37
  • @rjen

Hyperlinks not working on Front Page

Started by Kokoro, July 11, 2022, 01:16:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kokoro

Link to my forum: https://www.AnimeRPGs dot com/
SMF version: 2.1.2
TP version: 2.2.2
Default Forum Language: English
Theme name and version: Default (with Curve Color Changer v. 1.3 MOD)
Browser Name and Version: Firefox 102.0.1 (64-bit)
Mods installed: Activity Bar (2.0.1), Avatars Display Integration (1.5.3), Curve2 Color Changer (1.3), Dice Roller BBcode (2.0), Login Menu Button (2.0), Members Online Today (1.0), More Spiders (1.3.1), Post as Another Member (1.6), SMF 2.1.2 Update (1.0), SMF Gallery Lite (7.1), SMFPacks Social Login (2.3.2), Similar Topics (1.2.2), Yet Another Spoiler Mod (1.2)
Related Error messages: N/A

Problem:  Web links aren't working on Front Page article.


[list]
[li][url="https://www.animerpgs.com/index.php?topic=3.0"]Introduction to the Site[/url][/li]
[/list]

@rjen

Please provide more detail ; links are not working in what? Forum topics? Blocks? Articles ?

Please provide a full description on what you did to create the broken link.
Running Latest TP on SMF2.1 at: www.fjr-club.nl

@rjen

I just put your code in a frontpanel BBC code block on a test site and the link works just fine...

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

lurkalot

@rjen, did you click the link to see if it works?  It breaks for me on my test site.

I reported this bug some time back, when all my article links broke.  Seems removing the " " from beginning and end of link, then resaving seems to fix it.

Also, if I remember it was working ok in a front page block, it was bbc articles where they had this issue.

@rjen

Yeah, the link works just fine. The issue you are referring to was fixed in TP 2.2.2...

I assume you are referring to this one:
https://www.tinyportal.net/index.php?topic=36743.msg302241#msg302241
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Kokoro

Thank you!  Manually removing the end quotes fixed the problem.  I'll just have to remember to do that whenever I edit or make a new BBC article.

@rjen

Just reproduced it in a BBC article. It is actually the same issue we saw on the BBC blocks before: if the link is created with the quotes it breaks when parsed..

Remove the quotes and link will work, but it will break the next time the article is saved...

It is definately a bug in the BBC articles...

Note: I was a bit confused by the statement that links break on the frontpage. The link breaks in the article regardless of where is it showing...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Kokoro

Sorry, that was poor vocabulary on my part.  That's the only place I'm using articles at the moment.

lurkalot

Quote from: @rjen on July 11, 2022, 09:00:24 AM
Yeah, the link works just fine. The issue you are referring to was fixed in TP 2.2.2...

I assume you are referring to this one:
https://www.tinyportal.net/index.php?topic=36743.msg302241#msg302241

Yes, that was the one, I was confusing it with my other issue where it stripped all my bbc html tags and broke my articles.  But yes that thread you mentioned is the one.  Strange that issue came back after the fix. 

@rjen

It did not come back: that issue was with php blocks. And that still works ...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

What am I doing wrong? As I can't recreate it atm

See the images for what I have done..

@rjen

Create a bbc article with a hyperlink enclosed in quotes. Save it and view. Try the link. If it works, edit the article and save it again. Try the link again.
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Quote from: @rjen on July 24, 2022, 09:17:17 PM
Create a bbc article with a hyperlink enclosed in quotes. Save it and view. Try the link. If it works, edit the article and save it again. Try the link again.

Done that, it links through ok.

I'll add what I think is the fix. But I can't verify it.

@rjen

I can reproduce it, so I can verify the fix
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Try adding this the line above here:

https://github.com/Tinyportal/TinyPortal/blob/7652754b0ad9a81e3d96a73d3b1a2df6409a1cdc/Sources/TPArticle.php#L431


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


That breaks things for me and add's localhost on the second save, but I'm not sure if that's my environment.

tino

https://github.com/Tinyportal/TinyPortal/blob/7652754b0ad9a81e3d96a73d3b1a2df6409a1cdc/Sources/TPortalAdmin.php#L1010

This line also needs to be changed to


      if($context['TPortal']['editarticle']['type'] != 'bbc') {
        $context['TPortal']['editarticle']['body'] = $smcFunc['htmlspecialchars']($context['TPortal']['editarticle']['body'], ENT_QUOTES);
      }

@rjen

Just tested the fixes on two test sites and as far as I can see they fix the problem with the links in bbc articles.
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Kokoro