News: TinyPortal Release Schedule. Please read this update for More Info.

Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

November 20, 2019, 08:04:33 PM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 189262
  • Total Topics: 20773
  • Online Today: 70
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 33
Total: 33

Author Topic: Link goes no where  (Read 2845 times)

0 Members and 1 Guest are viewing this topic.

Offline @rjen

  • Support Team
  • *
  • Posts: 1925
    • FJR-club Nederland
Re: Link goes no where
« Reply #10 on: December 03, 2018, 03:18:18 AM »
Just updated my local install to todays version of Github and it still breaks...

You can check my phpinfo in my signature...
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info

Offline @rjen

  • Support Team
  • *
  • Posts: 1925
    • FJR-club Nederland
Re: Link goes no where
« Reply #11 on: December 03, 2018, 04:14:56 AM »
I think I found the cause of the problem... since we inject the Read More link onto the body text the SMF2.1 parser may affect it?

This code in Subs.php seems to cause the issue...

Code: [Select]
array(
'tag' => 'url',
'type' => 'unparsed_content',
'content' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">$1</a>',
'validate' => function (&$tag, &$data, $disabled)
{
$data = strtr($data, array('<br>' => ''));
$scheme = parse_url($data, PHP_URL_SCHEME);
if (empty($scheme))
$data = '//' . ltrim($data, ':/');
},

I could be wrong. Tino, can you check this?
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info

Offline @rjen

  • Support Team
  • *
  • Posts: 1925
    • FJR-club Nederland
Re: Link goes no where
« Reply #12 on: December 03, 2018, 04:21:05 AM »
Ok, yes, that's it.

When deactivating this option in SMF settings the links work...
Admin > Configuration > Bulletin Board code: Automatically link posted URLs

This 2.1 function seems to break the Read More link if activated...

So bigguy, for now you can consider deactivating that option till we find a fix...
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info

Offline tino

  • Developer
  • *
  • Posts: 1704
Re: Link goes no where
« Reply #13 on: December 03, 2018, 04:22:59 AM »
Weird I also have that checked and its ok.

Offline @rjen

  • Support Team
  • *
  • Posts: 1925
    • FJR-club Nederland
Re: Link goes no where
« Reply #14 on: December 03, 2018, 04:41:03 AM »
Weird I also have that checked and its ok.

and now what?

This settings makes and breaks the Read More links on the forum posts, so it must be at least related to the issue...
Perhaps it would be better to not include the Read More link in the body text, but add it separately somehow?
That way it will not be touched by SMF 's parser anymore...
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info

Offline tino

  • Developer
  • *
  • Posts: 1704
Re: Link goes no where
« Reply #15 on: December 03, 2018, 04:42:58 AM »
Weird I also have that checked and its ok.

and now what?

This settings makes and breaks the Read More links on the forum posts, so it must be at least related to the issue...
Perhaps it would be better to not include the Read More link in the body text, but add it separately somehow?
That way it will not be touched by SMF 's parser anymore...

My issue is it doesn't break for me... Second I can't see the path where we call the forum posts and then put it through parse_bbc...

Offline @rjen

  • Support Team
  • *
  • Posts: 1925
    • FJR-club Nederland
Re: Link goes no where
« Reply #16 on: December 03, 2018, 04:53:54 AM »
Quote
Second I can't see the path where we call the forum posts and then put it through parse_bbc...

Sorry, can you explain what you mean? Perhaps I am incorrectly using the parser reference.

What I see is that TPortal.php collects the posts to be displayed and adds a "Read More" link to the $row['body']

Then sometime later the $row['body'] is outputted onto the frontpage. I am not seeing where this happens in the code, but I assume somewhere the SMF logic kicks in and it changes the link  on screen...

Any hints as to where that happens would be appreciated...
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info

Offline tino

  • Developer
  • *
  • Posts: 1704
Re: Link goes no where
« Reply #17 on: December 03, 2018, 04:57:04 AM »
Any hints as to where that happens would be appreciated...

I can't see where it does that. It would be in the TPortal.template.php I would expect.

If disabling it fixes the issue then it is related to that somehow... I just can't work out how  :'(


Offline tino

  • Developer
  • *
  • Posts: 1704
Re: Link goes no where
« Reply #18 on: December 03, 2018, 04:59:07 AM »
Here are all the instances we use parse_bbc, with the line number after the file name.

Code: [Select]
grep -nr parse_bbc *
Sources/TPSubs.php:1686: echo parse_bbc($context['TPortal']['article']['intro']), '<p><b><a href="' .$scripturl . '?page=' , !empty($context['TPortal']['article']['shortname']) ? $context['TPortal']['article']['shortname'] : $context['TPortal']['article']['id'] , '' , WIRELESS ? ';' . WIRELESS_PROTOCOL : '' , '">'.$txt['tp-readmore'].'</a></b></p>';
Sources/TPSubs.php:1688: echo parse_bbc($context['TPortal']['article']['intro']);
Sources/TPSubs.php:1706: echo parse_bbc($context['TPortal']['article']['body']);
Sources/TPSubs.php:1764: echo parse_bbc($context['TPortal']['blockarticles'][$context['TPortal']['blockarticle']]['body']);
Sources/TPSubs.php:2336: $row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => '&#10;')));
Sources/TPdlmanager.php:544: 'description' => $context['TPortal']['dl_wysiwyg'] == 'bbc' ? parse_bbc(trim(strip_tags($row['description']))) : $row['description'],
Sources/TPdlmanager.php:690: 'description' => $context['TPortal']['dl_wysiwyg'] == 'bbc' ? parse_bbc(trim(strip_tags($row['description']))) : $row['description'],
Sources/TPdlmanager.php:774: 'description' => $context['TPortal']['dl_wysiwyg'] == 'bbc' ? parse_bbc(trim(strip_tags($row['description']))) : $row['description'],
Sources/TPdlmanager.php:930: 'description' => $context['TPortal']['dl_wysiwyg'] == 'bbc' ? parse_bbc(trim(strip_tags($row['description']))) : $row['description'],
Sources/TPdlmanager.php:1051: 'ingress' => $context['TPortal']['dl_wysiwyg']=='bbc' ? parse_bbc(trim(strip_tags($row['ingress']))) : $row['ingress'],
Sources/TPdlmanager.php:1350: 'description' => $context['TPortal']['dl_wysiwyg'] == 'bbc' ? parse_bbc(trim(strip_tags($row['description']))) : $row['description'],
Sources/TPortal.php:750: 'text' => parse_bbc($row['value2']),
Sources/TPortal.php:892: $context['TPortal']['printbody'] = parse_bbc($what);
Sources/TPortalAdmin.php:267: $message = trim(un_htmlspecialchars(strip_tags(strtr(parse_bbc($message2, false), array('<br />' => "\n", '</div>' => "\n", '</li>' => "\n", '&#91;' => '[', '&#93;' => ']')))));
Sources/TPmodules.php:591: $row['body'] = parse_bbc($row['body']);
Sources/TPmodules.php:1604: 'shout' => parse_bbc(censorText($row['value1'])),
Themes/default/TPsubs.template.php:1127: echo '<div class="blockbody" style="overflow: auto;' , !empty($context['TPortal']['blockheight_'.$side]) ? 'height: '.$context['TPortal']['blockheight_'.$side].';' : '' , '">' , parse_bbc($block['body']) , '</div>';
Themes/default/TPsubs.template.php:1163: echo parse_bbc($block['body']);
Themes/default/TPortalAdmin.template.php:350: <dd><div class="post">', !empty($mod['description']) ? parse_bbc($mod['description']) : '' , '</div>
Themes/default/TPShout.template.php:284: <p style="margin-top: 0;">' . parse_bbc($context['TPortal']['shoutbox_stitle'],true) . '</p><hr>';
Themes/default/TPdlmanager.template.php:55: <div class="windowbg tp_pad" style="margin-bottom: 5px">' , $context['TPortal']['dl_wysiwyg'] == 'bbc' ? parse_bbc($context['TPortal']['dl_introtext']) : $context['TPortal']['dl_introtext'] , '</div>';
tp-files/tp-modules/TPShout/Sources/TPShout.php:648: $row['value1'] = parse_bbc(censorText($row['value1']), true);
tp-files/tp-blockcodes/singleshout.blockcode:60: $row['value1'] = parse_bbc(censorText($row['value1']), true);

Offline @rjen

  • Support Team
  • *
  • Posts: 1925
    • FJR-club Nederland
Re: Link goes no where
« Reply #19 on: December 03, 2018, 04:59:41 AM »
Can you check the settings for the allowed tags?

It seems that the url tag is causing it.
If I disable the url tag I can leave the autolink URL on, and it also works...
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info