vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   lost (https://vborg.vbsupport.ru/showthread.php?t=37869)

Dixiemill 04-25-2002 05:28 PM

lost
 
I can't seem to locate the thread(s) about how to disable HTML tags. A search on the word "HTML" doesn't seem to yield the thread(s) I'm looking for.

:ermm:

- I want to disable all HTML tags. without disabling the vb codes.
- I want "Automatically parse URLs: automatically adds and around internet addresses. " to always be "no"
- I want the button http:// to not work

I want to stop my website url from showing up on other servers via referrers. I host a private site on a private url and intend to keep it that way. (We've been hacked and cracked at least 4 times already and want to do everything we can to stop it.)

NTLDR 04-25-2002 06:03 PM

Firstly, to remove the http:// and prevent automaticly putting [ URL ] around URLS you need to remove the vb code for the [ URL ] tag in the admin CP, to disable HTML in posts you change the relevent option in the vBulletin Options part of the Admin CP.

Hope this helps,
Lee

Dixiemill 04-25-2002 06:15 PM

Quote:

you need to remove the vb code for the [ URL ] tag in the admin CP
I'm in the Admin CP, clicked on "modify custom VB Codes" The URL tag is not in there. Doesn't exist. I have bold, italic, email, etc. but not url.

I've looked all around the admin Cp and the php files....

In templates the response for the "automatically parse urls" is a $parseurlChecked value... how and where do I set that value so that it is permanently unchecked.

NTLDR 04-25-2002 06:29 PM

OK, To remove the Parsing of URL's I think you need to remove the following from functions.php (Make sure you backup the file first, I haven't tested it and am not resposible if it goes wrong ;) )

And remove $parseurlChecked from the template

PHP Code:

// ###################### Start checkurl #######################
function checkurl($url$hyperlink="") {
  
$righturl $url;
  if(!
preg_match("![a-z]://!si"$url)) {
    
$righturl "http://$righturl";
  }
  
// remove threat of users including javascript in url
  /*$righturl = preg_replace("/javascript:/si", "java script:", $righturl);
  $righturl = preg_replace("/about:/si", "about :", $righturl);*/
  
$hyperlink iif(trim($hyperlink)=="" or $hyperlink==$urliif(strlen($url)>55,substr($url,0,35)."...".substr($url,-15),$url) ,$hyperlink);
  return 
"<a href=\"$righturl\" target=\"_blank\">".str_replace('\"''"'$hyperlink)."</a>";
}

// ###################### Start parseurl #######################
function parseurl($messagetext)
// the auto parser - adds [url] tags around neccessary things

  
global $urlSearchArray$urlReplaceArray$emailSearchArray$emailReplaceArray;

  if (!isset(
$urlSearchArray)) {
    
$urlSearchArray = array(
      
"/([^]_a-z0-9-=\"'\/])((https?|ftp|gopher|news|telnet):\/\/|www\.)([^ \r\n\(\)\^\$!`\"'\|\[\]\{\}<>]*)/si",
      
"/^((https?|ftp|gopher|news|telnet):\/\/|www\.)([^ \r\n\(\)\^\$!`\"'\|\[\]\{\}<>]*)/si"
    
);

    
$urlReplaceArray = array(
      
"\\1[url]\\2\\4[/url]",
      
"[url]\\1\\3[/url]"
    
);

    
$emailSearchArray = array(
      
"/([ \n\r\t])([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,4}))/si",
      
"/^([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,4}))/si"
    
);

    
$emailReplaceArray = array(
      
"\\1[email]\\2[/email]",
      
"[email]\\0[/email]"
    
);
  }

  
$text preg_replace($urlSearchArray$urlReplaceArray$messagetext);
  if (
strpos($text"@")) {
    
$text preg_replace($emailSearchArray$emailReplaceArray$text);
  }

  return 
$text;



Let me know if that works.

Dixiemill 04-25-2002 06:31 PM

I'll try that. Right now one of our servers just crashed... might be sometime before I get back to you. Thank you for the quick reply.

NTLDR 04-25-2002 06:36 PM

No problem Dixiemill I hope it works for you :D

Dixiemill 04-25-2002 07:54 PM

I found that removing the code from checkurl and parseurl erases the whole message if a link is anywhere in the message.

But your lead was not in vain... I was successfully able to disable "hotlinks" by simply changing the last line in the function checkurl from:

return "<a href=\"$righturl\" target=\"_blank\">".str_replace('\"', '"', $hyperlink)."</a>";


to:
return "<a =\"$righturl\" >".str_replace('\"', '"', $hyperlink)."</a>";


now when I type www.test.com in the message or use the http:// button in the vbcode area the url appears as text not a hotlink.

NTLDR 04-25-2002 07:59 PM

I knew that code had something to do with it, and as it wasn't a vB code in the admin CP I guessed it would be in funcions.php so I just did a quick serach, I'm glad it helped :D

Was there anything else that you needed help on or was it just the hyperlinks?

Dixiemill 04-25-2002 08:01 PM

Just the hyperlinks... I'm trying to keep my site url from appearing on other servers via referrers.

Thanks again for all the help.

NTLDR 04-25-2002 08:09 PM

No problem, glad I could help you out.


All times are GMT. The time now is 03:07 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.01103 seconds
  • Memory Usage 1,749KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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