Solved

Vb code not finding function

Posted on 2013-01-17
2
341 Views
Last Modified: 2013-01-17
I'm  not sure what function this code is attempting to use.  This is re-writing old code to work with current versions of .net  currently the function Request() is flagged as undeclared. I'm not sure the original intent of this function or where to find it.

Partial Public Class _loginlookup
 

    

function stripQuotes(strWords) 
	stripQuotes = replace(strWords, "'", "''") 
end function 

function killChars(strWords) 
	dim badChars(0 to 6) as string
	dim newChars as string
	dim i 


	badChars(0) = "select"
    badChars(1) = "drop"
    badChars(2) = ";"
    badChars(3) = "--"
    badChars(4) = "insert"
    badChars(5) = "delete"
    badChars(6) = "xp_"
	newChars = strWords 
	
	for i = 0 to uBound(badChars)
		newChars = replace(newChars, badChars(i), "")
	next 
	killChars = newChars 
end function 

function HTMLEncoder(strWords) as string
	
    HTMLEncoder = System.Web.HttpContext.Current.Server.HTMLEncode(strWords)
end function

'Used to secure request objects (Strings ONLY)
function allSecure(fieldName)
	allSecure = stripQuotes(killChars(HTMLEncoder(Request(fieldName))))
end function

'Used to secure variables
function allSecure2(fieldName)
	allSecure2 = stripQuotes(killChars(HTMLEncoder(fieldName)))
end function

end class

Open in new window

0
Comment
Question by:UnderSeven
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
Comment Utility
It looks like accessing the Request query parameter i.e. the current Request.
Try

System.Web.HttpContext.Current.Request(fieldName)

Open in new window

0
 

Author Closing Comment

by:UnderSeven
Comment Utility
Thank you!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now