68 Classifieds API

Features
class tree: 68Classifieds | index: 68Classifieds | all elements

 Class Filter

Description

Static class that is used to filter data.

  • author: John Snyder
  • version: 0.1
  • copyright: Copyright (c) 2008, John Snyder
  • license: GNU Public License

Located in /includes/classes/format/Filter.php (line 22)


	
			
Method Summary
 string alpha (string $input)
 string alphaNumeric (string $input)
 string cleanDate (string $date)
 string cleanDirName (string $input)
 string cleanEmailInjection (string $string)
 string cleanFileName (string $input)
 string cleanKey (string $input)
 string cleanText (string $string)
 string cleanUrl (string $input)
 string cleanXSS (string $value)
 double double (string $input)
 string filterword (string $value)
 raw httpURL (string $input)
 string mysqlEscape (string $string)
 string mysqlEscapeLike (string $string)
 string mysqlEscapeLikeXSS (string $string)
 string mysqlEscapeXSS (string $value)
 void mysqlInt ( $int)
 string mysqlLike (string $string)
 string nonTagHtmlEntities (string $string)
 string numeric (string $input)
 string stripTags (string $value)
 string taglessHtmlEntities (string $string)
 string utf8Encode (string $string)
 string YorN (string $input)
Methods
alpha (line 82)

Replaces all but letters of the alphabet A-Z

  • return: contains only letters a-z; not case sensitive
  • access: public
string alpha (string $input)
  • string $input
alphaNumeric (line 94)

Returns only letters and numbers, a-z:0-9 not case sensitive

  • return: contains only a-z:0-9 that remains; not case sensitive
  • access: public
string alphaNumeric (string $input)
  • string $input
cleanDate (line 228)

Clean string for use as date 0-9./-

  • access: public
string cleanDate (string $date)
  • string $date
cleanDirName (line 175)

Cleans a string for use as a directory name

  • access: public
string cleanDirName (string $input)
  • string $input
cleanEmailInjection (line 201)

Clean up string for use in email, remove injection attempts

  • access: public
string cleanEmailInjection (string $string)
  • string $string
cleanFileName (line 163)

Cleans a string for use as a file name

  • access: public
string cleanFileName (string $input)
  • string $input
cleanKey (line 151)

Filters out unsafe characters for array keys

  • return: with only key safe characters
  • access: public
string cleanKey (string $input)
  • string $input
cleanText (line 287)

Encode MS Word characters

  • access: public
string cleanText (string $string)
  • string $string
cleanUrl (line 186)

Cleanup string for use as a url

string cleanUrl (string $input)
  • string $input
cleanXSS (line 274)

Remove harmful content from string

  • return: filtered string
  • access: public
string cleanXSS (string $value)
  • string $value: unfiltered string
double (line 105)

Removes all but numbers and decimal

double double (string $input)
  • string $input
filterword (line 48)

Filter a string based off bad words from administration.

  • return: The filtered string.
string filterword (string $value)
  • string $value: The value
httpURL (line 135)

Adds http:// to urls that don't have it

  • return: url + http:// if not already present
  • access: public
raw httpURL (string $input)
  • string $input
mysqlEscape (line 244)

Escape a string for use in mysql statement

  • access: public
string mysqlEscape (string $string)
  • string $string
mysqlEscapeLike (line 392)

Escape and wrap a string with % for mysql LIKE statements

string mysqlEscapeLike (string $string)
  • string $string
mysqlEscapeLikeXSS (line 403)

Escape, wrap with %, and remove XSS attempts

string mysqlEscapeLikeXSS (string $string)
  • string $string
mysqlEscapeXSS (line 257)

Escape and remove XSS attempts for use in mysql statement

  • access: public
string mysqlEscapeXSS (string $value)
  • string $value
mysqlInt (line 233)
void mysqlInt ( $int)
  • $int
mysqlLike (line 381)

Wraps string with %

  • access: public
string mysqlLike (string $string)
  • string $string
nonTagHtmlEntities (line 322)

Utf8 encodes, converts word chars, and converts everything but to html entities but html tags.

  • return: - all html entities but html tags
  • access: public
  • uses: html_entity_decode
  • uses: htmlentities
  • uses: Filter::utf8Encode
  • uses: Filter::cleanText
string nonTagHtmlEntities (string $string)
  • string $string
numeric (line 70)

Replaces all but numbers in a string

  • return: remaining numbers after replacement
  • access: public
string numeric (string $input)
  • string $input
stripTags (line 31)

Strip HTML Tags

string stripTags (string $value)
  • string $value
taglessHtmlEntities (line 345)

Utf8 encodes, converts word chars, strips tags, and converts everything but to html entities.

string taglessHtmlEntities (string $string)
  • string $string
utf8Encode (line 365)

Convert a string to UTF-8, attempts to use mb_string extension otherwise defaults to encode

  • return: utf-8 encoded string
  • access: public
  • uses: utf8_encode
  • uses: mb_convert_encoding
string utf8Encode (string $string)
  • string $string
YorN (line 119)

Enforces Y or N as value of input, case sensitive and defaults to N

  • return: Y or N
  • access: public
string YorN (string $input)
  • string $input