vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=229729

Show full url links instead of shortening it?
by fme
07 Dec 2009 19:37

Hi, when users post a long link the forum automatically shortens it by adding "..." for example:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


something like this will come up:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Is there an option on how I can make it show the full url link instead of it being shorten? thanks

Lynne 07 Dec 2009 19:59

This has been posted about before. You need to actually edit the code. Try a search for it and it should come up. Or do a search in your files for "..." and it should come up (that's how I found it).

fme 07 Dec 2009 20:12

Thanks for the reply. But i've tried searching on Vbulletin.com and Vbulletin.org for hours and of course I did the basic phrase / template search for "..." before posting this thread. I came up with nothing.

can you please direct me to the post or what to type into the search field? I might just be retarded and missing the most simplest word for this.

Lynne 07 Dec 2009 20:36

Search your php files for '...', not the templates/phrases. I think it will show up in some bbcode function, if I recall correctly.

Valter 18 Sep 2010 12:15

Hi Lynne,

Are you able to do this in vB4?

I've tried to disable stripping in handle_bbcode_url function in class_bbcode.php but it does not work. postparsed table is truncated.

Any idea?

Thanks.

Lynne 18 Sep 2010 15:27

Yes, it works in vb4 also. I saved this blurb from another thread about it:

Quote:

I believe you want to find these lines in includes/class_bbcode.php in the function handle_bbcode_url
PHP Code:
if (vbstrlen($tmp) > 55 AND $this->is_wysiwyg() == false)
{
$text = htmlspecialchars_uni(vbchop($tmp, 36) . '...' . substr($tmp, -14));
}
Line 2091-2095 in v4.0.3.

55 = number of characters before it's stripped
36 = number of characters before the (...)
14 = number of characters after the (...)

GONUMBER6 02 Nov 2010 18:35

This was very useful info, thank you as always Lynne!

dmm2020 19 Jan 2012 05:08

Quote:

Originally Posted by Lynne (Post 2100062)
Yes, it works in vb4 also. I saved this blurb from another thread about it:

Glad I found this post.

I was having problems in latest version of vB 4.1.5 where I posted download links for alpha testers of my script on my forum and it initially worked for them, but when I went back to the page a day later, link would be corrupted. But when I edited the script, the full link showed in the edit mode. I commented the block of code you reference out and problem goes away for me.

Thanks.

postcd 30 Nov 2013 14:18

Quote:

Originally Posted by Lynne (Post 2100062)
Yes, it works in vb4 also. I saved this blurb from another thread about it:

I changed that number to 512

so it is:

Quote:

if (vbstrlen($tmp) > 512 AND $this->is_wysiwyg() == false)
{
$text = htmlspecialchars_uni(vbchop($tmp, 36) . '...' . substr($tmp, -14));
}
But its still shortened even i tried to post new reply with long links (less than 512 chars.)

tini_lam 20 Aug 2014 04:02

In FILE class_bbcode.php have 2 line need edit.

edit

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Paul M 20 Aug 2014 12:46

Do not comment that line out. You are opening an XSS security hole by removing the htmlspecialchars call.

MaXimus 20 Aug 2014 17:48

Even better, you can have the URL auto convert into the Title of the page:

http://www.vbulletin.org/forum/showthread.php?t=189658

postcd 16 Jan 2020 08:43

Quote:

Originally Posted by Paul M (Post 2512115)
Do not comment that line out. You are opening an XSS security hole by removing the htmlspecialchars call.

In the file /includes/class_bbcode.php i found two lines:
$text = htmlspecialchars_uni(vbchop($tmp, 36) . '...' . substr($tmp, -14));

so i replaced both by:
$text = htmlspecialchars_uni($text);

and it seems to work (no link shortenings). Is that better regarding security?
https://www.w3schools.com/PHP/func_s...ecialchars.asp


All times are GMT. The time now is 09:17.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.