vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Show full url links instead of shortening it? (https://vborg.vbsupport.ru/showthread.php?t=229729)

fme 12-07-2009 06:37 PM

Show full url links instead of shortening it?
 
Hi, when users post a long link the forum automatically shortens it by adding "..." for example:

Code:

http://news.google.com/news/section?pz=1&cf=all&topic=po&ict=ln

something like this will come up:
Code:

http://news.google.com/news/se...c=po&ict=ln

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

Lynne 12-07-2009 06:59 PM

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 12-07-2009 07:12 PM

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 12-07-2009 07:36 PM

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

Valter 09-18-2010 11:15 AM

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 09-18-2010 02:27 PM

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 11-02-2010 05:35 PM

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

dmm2020 01-19-2012 05:08 AM

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 11-30-2013 02:18 PM

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 08-20-2014 03:02 AM

In FILE class_bbcode.php have 2 line need edit.

edit
PHP Code:

$text htmlspecialchars_uni(vbchop($tmp36) . '...' substr($tmp, -14)); 

to
PHP Code:

// $text = htmlspecialchars_uni(vbchop($tmp, 36) . '...' . substr($tmp, -14)); 


Paul M 08-20-2014 11:46 AM

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

MaXimus 08-20-2014 04:48 PM

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

https://vborg.vbsupport.ru/showthread.php?t=189658

postcd 01-16-2020 07:43 AM

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 06:19 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01227 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete