vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Variable declaration and sanitization! (https://vborg.vbsupport.ru/showthread.php?t=184353)

v0xb0x 07-04-2008 05:09 AM

Variable declaration and sanitization!
 
I have a series of variables I am declaring in a plug-in that fires in global_start.

These variables are all strings.

What is the best way to sanitize the variables? Currently, I am declaring them like this:

$ccDiscVar = '';
$ccHomeVar = '';
$ccCaleVar = '';
$ccBaseCity = '';
$urlArray = '';

[CODE FOLLOWS]

Thanks for any comments.

Antivirus 07-04-2008 05:39 PM

If you're getting them from $_POST, $_GET, or $_REQUEST, they should be cleaned using the $vbuletin->GPC class. There's a really good tuitorial in the articles section about this

Dismounted 07-05-2008 06:14 AM

Quote:

Originally Posted by Antivirus (Post 1566855)
If you're getting them from $_POST, $_GET, or $_REQUEST, they should be cleaned using the $vbuletin->GPC class. There's a really good tuitorial in the articles section about this

You mean the input cleaner class ;), $vbulletin->input. $vbulletin->GPC simply holds cleaned values.

You can also clean any value you want, not just GPC (get, post, cookies), using the input cleaner.

v0xb0x 07-06-2008 09:48 PM

Quote:

Originally Posted by Dismounted (Post 1567156)
You mean the input cleaner class ;), $vbulletin->input. $vbulletin->GPC simply holds cleaned values.

You can also clean any value you want, not just GPC (get, post, cookies), using the input cleaner.

Understood.

Thanks for the reply.

I'll investigate the article.

Appreciate the help.


All times are GMT. The time now is 02:44 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.01130 seconds
  • Memory Usage 1,713KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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