Advertisement
Guest User

Untitled

a guest
Dec 15th, 2011
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1.     protected function _getPosts(){
  2.        
  3.         if(!(!isset($_POST) || count($_POST) == 0)){
  4.             foreach($_POST as $key=>&$post){
  5.                 $this->posts[$key] = $this->_mres($post); //escape all randomness
  6.             }
  7.         }
  8.        
  9.     }
  10.    
  11.     protected function _mres($q) {
  12.         if(is_array($q)) {
  13.             foreach($q as $k => $v) {
  14.                 $q[$k] = $this->_mres($v); //recurse into array
  15.             }
  16.         }
  17.         elseif(is_string($q))   {
  18.             $q = mysql_real_escape_string($q);
  19.         }
  20.         return $q;
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement