From bff3de7efba28c88b90d614d6e35df79efd84f99 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 17 Feb 2007 22:50:30 +0000 Subject: [PATCH] Refactoring to keep in line with our naming standards --- Input.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Input.php b/Input.php index 64586ea..b30d0ec 100644 --- a/Input.php +++ b/Input.php @@ -112,11 +112,11 @@ class BSInput BSRegister::Debug('magic_quotes_gpc = ' . $this->magicquotes); BSRegister::Debug('register_globals = ' . ini_get('register_globals')); - $this->sanitizeInputData(); + $this->_sanitizeInputData(); if (defined('ISSO_CHECK_POST_REFERER')) { - $this->checkPostReferer(); + $this->_checkPostReferer(); } } @@ -128,13 +128,13 @@ class BSInput * * @return mixed Sanitized data */ - private function sanitizeDataRecursive($data) + private function _sanitizeDataRecursive($data) { foreach ($data AS $key => $value) { if (is_array($value)) { - $data["$key"] = $this->sanitizeDataRecursive($value); + $data["$key"] = $this->_sanitizeDataRecursive($value); } else { @@ -201,7 +201,7 @@ class BSInput * Smart addslashes() that only applies itself it the Magic Quotes GPC * is off. This should only be run on database query values that come * from ISSO->in[] input; data that needs sanitization should be run - * through ISSO->DB->escape_string() + * through Db->escapeString() * * @param string Some string * @param bool Force magic quotes to be off @@ -214,7 +214,7 @@ class BSInput { if (BSRegister::GetType('Db')) { - return BSRegister::GetType('Db')->escape_string(str_replace(array("\'", '\"'), array("'", '"'), $str)); + return BSRegister::GetType('Db')->escapeString(str_replace(array("\'", '\"'), array("'", '"'), $str)); } return $str; } @@ -222,7 +222,7 @@ class BSInput { if (BSRegister::GetType('Db')) { - return BSRegister::GetType('Db')->escape_string($str); + return BSRegister::GetType('Db')->escapeString($str); } return addslashes($str); } @@ -232,16 +232,16 @@ class BSInput /** * Runs through all of the input data and sanitizes it. */ - private function sanitizeInputData() + private function _sanitizeInputData() { - $this->in = $this->sanitizeDataRecursive(array_merge($_GET, $_POST, $_COOKIE)); + $this->in = $this->_sanitizeDataRecursive(array_merge($_GET, $_POST, $_COOKIE)); } // ################################################################### /** * Sanitize function for something other than a string (which - * everything is sanitized for if you use sanitizeInputData(). Cleaned - * data is placed back into ISSO->in; this makes it so you don't have + * everything is sanitized for if you use _sanitizeInputData(). Cleaned + * data is placed back into Input->in; this makes it so you don't have * to constantly intval() [etc.] data. * * @param array Array of elements to clean as varname => type @@ -278,9 +278,9 @@ class BSInput // ################################################################### /** - * Runs ISSO->escape() on a variable on ISSO->in[]. This is just a + * Runs Input->escape() on a variable on Input->in[]. This is just a * short-hand wrapper so that queries can be shortened. When this is used, - * the actual value in ISSO->in[] is not changed, only the return value + * the actual value in Input->in[] is not changed, only the return value * is escaped. * * @param string Input variable @@ -303,7 +303,7 @@ class BSInput /** * Cleaning function that does the work for inputClean(); this is * moved here so it can be used to clean things that aren't in - * ISSO->in[] + * Input->in[] * * @param mixed Data * @param integer Sanitization type constant @@ -314,7 +314,7 @@ class BSInput { if (is_array($value)) { - return $this->cleanArray($value, $type); + return $this->_cleanArray($value, $type); } if ($type == TYPE_INT) @@ -367,14 +367,14 @@ class BSInput // ################################################################### /** - * Recursion function for ISSO->clean() + * Recursion function for Input->clean() * * @param array Uncleaned array * @param integer Sanitization type constant * * @return array Cleaned array of data */ - private function cleanArray($array, $type) + private function _cleanArray($array, $type) { foreach ($array AS $key => $value) { @@ -404,9 +404,9 @@ class BSInput /** * Checks to see if a POST refer is actually from us */ - private function checkPostReferer() + private function _checkPostReferer() { - if ($_SERVER['REQUEST_METHOD'] == 'POST') + if ($this->getHttpMethod() == 'post') { $host = ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_ENV['HTTP_HOST']; -- 2.43.5