Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

November 29, 2022, 11:20:17 PM

Login with username, password and session length
Members
  • Total Members: 3853
  • Latest: tty456
Stats
  • Total Posts: 193625
  • Total Topics: 21107
  • Online today: 71
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 0
Guests: 43
Total: 43

Author Topic: Hyperlinks not working on Front Page  (Read 1140 times)

0 Members and 1 Guest are viewing this topic.

Offline tino

  • Developer
  • *
  • Posts: 2641
Re: Hyperlinks not working on Front Page
« Reply #10 on: July 24, 2022, 01:46:58 PM »
What am I doing wrong? As I can't recreate it atm

See the images for what I have done..

Offline @rjen

  • Support Team
  • *
  • Posts: 3342
    • FJR-club Nederland
Re: Hyperlinks not working on Front Page
« Reply #11 on: July 24, 2022, 02: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.
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Offline tino

  • Developer
  • *
  • Posts: 2641
Re: Hyperlinks not working on Front Page
« Reply #12 on: July 24, 2022, 02:19:41 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.

Offline @rjen

  • Support Team
  • *
  • Posts: 3342
    • FJR-club Nederland
Re: Hyperlinks not working on Front Page
« Reply #13 on: July 24, 2022, 02:27:10 PM »
I can reproduce it, so I can verify the fix
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Offline tino

  • Developer
  • *
  • Posts: 2641
Re: Hyperlinks not working on Front Page
« Reply #14 on: July 24, 2022, 02:43:39 PM »
Try adding this the line above here:

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

Code: [Select]
            // 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.

Offline tino

  • Developer
  • *
  • Posts: 2641
Re: Hyperlinks not working on Front Page
« Reply #15 on: July 24, 2022, 02:53:33 PM »
https://github.com/Tinyportal/TinyPortal/blob/7652754b0ad9a81e3d96a73d3b1a2df6409a1cdc/Sources/TPortalAdmin.php#L1010

This line also needs to be changed to

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

Offline @rjen

  • Support Team
  • *
  • Posts: 3342
    • FJR-club Nederland
Re: Hyperlinks not working on Front Page
« Reply #16 on: July 25, 2022, 01:44:57 AM »
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

Offline Kokoro

  • Jr. Member
  • **
  • Posts: 11
Re: Hyperlinks not working on Front Page
« Reply #17 on: August 06, 2022, 04:12:45 PM »
Thank you!  That fixed it great!