vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   & into & in thread title (https://vborg.vbsupport.ru/showthread.php?t=200648)

veenuisthebest 01-04-2009 12:01 PM

& into & in thread title
 
When we create a thread in vbulletin with a title like "google & yahoo", it automatically converts into "google & yahoo" as viewed in source.

This saves one 1 xhtml error.

How do we do it?

Thank you

UKBusinessLive 01-04-2009 12:03 PM

Do you have html enabled in your title field?? Not 100% sure but it looks like this kind of problem :confused:

if not its probably when you Imported some data, have you imported anything lately or converted from one other forum to VBulletin??

veenuisthebest 01-04-2009 12:09 PM

Quote:

Originally Posted by UKBusinessLive (Post 1701222)
Do you have html enabled in your title field?? Not 100% sure but it looks like this kind of problem :confused:

I am not sure what you are talking about. What does enabling html have to do with it?

I just want to know, how & is converted to & automatically in thread titles in vb so that I can do the same in my custom script otherwise it gives xhtml error if & is not escaped.

UKBusinessLive 01-04-2009 12:13 PM

Quote:

Originally Posted by veenuisthebest (Post 1701231)
I am not sure what you are talking about. What does enabling html have to do with it?

I just want to know, how & is converted to & automatically in thread titles in vb so that I can do the same in my custom script otherwise it gives xhtml error if & is not escaped.


:o Sorry buddy i thought you had a problem with & replacing & in your forum titles, Now you've explained it a bit better i'll see if i can find out for you:D

veenuisthebest 01-04-2009 12:17 PM

Quote:

Originally Posted by UKBusinessLive (Post 1701235)
:o Sorry buddy i thought you had a problem with & replacing & in your forum titles, Now you've explained it a bit better i'll see if i can find out for you:D

ha its okay.. you were just trying to help :D

btw, i think i found the solution. Can anybody confirm if vbulletin uses the same?
http://www.w3schools.com/PHP/func_st...ecialchars.asp

Thanks

Marco van Herwaarden 01-04-2009 12:38 PM

Yes vBulletin will also use htmlspecialchars() or htmlspecialchars_uni() .

veenuisthebest 01-04-2009 12:56 PM

Quote:

Originally Posted by Marco van Herwaarden (Post 1701264)
Yes vBulletin will also use htmlspecialchars() or htmlspecialchars_uni() .

Thanks for confirming sir.

Btw, I just figured this out and achieved this by using vBulletin input cleaner. I think vb does it like this.

I had the title variable in my script as 'title' => TYPE_STR

I changed it to 'title' => TYPE_NOHTML. This takes care of all those characters being escaped.

Dismounted 01-05-2009 02:16 AM

TYPE_NOHTML will run the checks as in TYPE_STR, as well as running htmlspecialchars_uni() on the string.

BTW, htmlspecialchars_uni() is not a default PHP function, it is created by vBulletin.


All times are GMT. The time now is 01:07 AM.

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.01130 seconds
  • Memory Usage 1,725KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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