Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mysidia Adoptables Official Announcement (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=2)
-   -   Mysidia Adoptables v1.3.2[Security Release] (http://www.mysidiaadoptables.com/forum/showthread.php?t=3878)

Hall of Famer 12-12-2012 12:15 PM

You have a malfunctioning double colon operator in that script file, remove it and see what happens.

SilverDragonTears 12-12-2012 12:24 PM

???
Code:

<?php

abstract class User{
  // The abstract class User
  public $uid = 0;
  public $username;
  public $ip;
  public $usergroup;
  public $lastactivity;
 
  public function getid(){
    return $this->uid;
  }

  public function getusername(){
    return $this->username;
  }
 
  public function getcurrentip(){
    return $this->ip;
  }
 
  public function getgroupid(){
    if(is_numeric($this->usergroup)) return $this->usergroup;
    else return $this->usergroup->gid;
  }
 
  public function getgroup(){
    return $this->usergroup;
  }
 
  public function lastactivity(){
    return $this->lastactivity;
  }
 
 
  public function isbanned(){
    // will be added later
  }
 
}
?>


Hall of Famer 12-12-2012 12:30 PM

I mean, this file: classes/class_input.php

SilverDragonTears 12-12-2012 12:48 PM

Oh. Ok what am I looking for exactly?

Hall of Famer 12-12-2012 01:01 PM

Well I said you need to look into classes/class_input and search for line 120 that seems to be malfunctioning. It seems to have two colons that cause the trouble, you need to remove them.

SilverDragonTears 12-12-2012 01:04 PM

I removed one and got Parse error: syntax error, unexpected ':' in /home/taleofdr/public_html/classes/class_input.php on line 120

Hall of Famer 12-12-2012 01:12 PM

Then how about removing them both? What does that file look like on your server anyway?

SilverDragonTears 12-12-2012 01:13 PM

I did. Still got an error.
Parse error: syntax error, unexpected T_VARIABLE in /home/taleofdr/public_html/classes/class_input.php on line 120

I'm starting to think I won't be able to add in the adopt shop :/

Code:

<?php

/**
 * The Input Class, it is one of Mysidia system core classes.
 * It acts as a secure wrapper for user input in $_GET and $_POST.
 * Input is a final class, no child class shall derive from it.
 * An instance of Input class is generated upon Mysidia system object's creation.
 * This specific instance is available from Registry, just like any other Mysidia core objects.
 * @category Resource
 * @package Core
 * @author Hall of Famer
 * @copyright Mysidia Adoptables Script
 * @link http://www.mysidiaadoptables.com
 * @since 1.3.2
 * @todo incorporate input class in Mysidia adoptables system.
 */

final class Input{

    /**
        * The request property, which holds request method information: get, post or else.
        * @access public
        * @var String
    */
    public $request;
       
        /**
        * The post property, it stores all user input vars in $_POST.
        * @access private
        * @var ArrayObject
    */
    private $post;
       
        /**
        * The get property, it stores all user input vars in $_GET.
        * @access private
        * @var ArrayObject
    */
    private $get;
       
        /**
        * The action property, which specifies users action.
        * @access private
        * @var String
    */
    private $action;

       
        /**
    * Constructor of Input Class, it generates basic properties for an input object.
    * @access public
    * @return Void
    */       
    public function __construct(){       
        $this->checkrequest();
            $this->initialize();
    }
 
    /**
    * The initialize method, which handles parsing of user input vars.
    * @access public
    * @return Void
    */
    public function initialize(){
            if(isset($_POST)){
                $post = array_map('secure',$_POST);
                    $this->post = new ArrayObject($post, ArrayObject::ARRAY_AS_PROPS);
                    if(isset($this->post->action)) $this->action = $this->post->action;
            unset($_POST);   
            }
            if(isset($_GET)){
                $get = array_map('secure',$_GET);
                $this->get = new ArrayObject($get, ArrayObject::ARRAY_AS_PROPS);
                    if(isset($this->get->action)) $this->action = $this->get->action;
            unset($_GET);
            }
        if(defined("SUBDIR")){
            $parser = new UrlParser($_SERVER['REQUEST_URI']);
                        $elements = $parser->parse();
                        $get = array_map('secure', $elements);
                        $this->get = new ArrayObject($get, ArrayObject::ARRAY_AS_PROPS);
            if(isset($this->get->action)) $this->action = $this->get->action;
        }               
    }
 
    /**
    * The post method, returns a user input var stored in Input::$post property.
        * @param String  $key
    * @access public
    * @return Object
    */
    public function post($key = ""){
        if(empty($key) and !empty($this->post)) return $this->post;
            elseif(isset($this->post->{$key})) return $this->post->{$key};
            else return FALSE;
    }
 
    /**
    * The get method, returns a user input var stored in Input::$get property.
        * @param String  $key
    * @access public
    * @return Object
    */
    public function get($key = ""){
        if(empty($key) and !empty($this->get)) return $this->get;
            elseif(isset($this->get->{$key})) return $this->get->{$key};
            else return FALSE;   
    }

    /**
    * The manipulate method, set values in a get variable from post variable.
    * This can be manipulated by controller objects.
    * It serves as a temporary solution to url rewrite problem with get forms.
        * @param String  $controller
    * @access public
    * @return Void
    */
    public function manipulate($controller){
        if(!($controller instanceof AppController)) throw new Exception("Controller not found.");
        elseif(is_array($controller::$param)){
            foreach($controller::$param as $key){
                if($this->post->{$key}) $this->get->{$key} = $this->post->{$key};
            }
        }
        else{
            $key = $controller::$param;
            if($this->post->{$key}) $this->get->{$key} = $this->post->{$key};
        } 
    }
 
    /**
    * The action method, verifies whether a specified action is taken by this user.
        * @param String  $act
    * @access private
    * @return Boolean
    */
    public function action(){
        if(empty($this->action)) return FALSE;
            else return $this->action;
    }
 
    /**
    * The checkrequest method, checks to see the request method of a particular user
    * @access private
    * @return Boolean
    */
    private function checkrequest(){
        // This method checks if there is user input, and returns the request_method if evaluated to be true
        if($_SERVER['REQUEST_METHOD'] == "POST"){
                  $this->request = "post";
                    return TRUE;
            }       
            elseif($_SERVER['REQUEST_METHOD'] == "GET"){
                $this->request = "get";
                    return TRUE;
            }       
            else $this->request = FALSE;
    }
 
    /**
    * The secure method, parse user input in a safe manner.
        * @param Array  $data
    * @access private
    * @return ArrayObject
    */
    private function secure($data){
        if(is_array($data) and SUBDIR != "AdminCP") die("Hacking Attempt!");
            $data = htmlentities($data);
        $data = addslashes($data);       
            $data = strip_tags($data, '');
            return $data;
    } 
}
?>


Hall of Famer 12-12-2012 02:04 PM

I see, you dont have a controller object, and thus the double colons are invalid. You shouldnt be using the input class at all, get rid of it and see what happens.

SilverDragonTears 12-12-2012 02:08 PM

Ok where is it and what exact part? Sorry, I don't want to mess anything up and I'm not familiar with it at all.


All times are GMT -5. The time now is 06:54 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.