View Single Post
  #10  
Old 01-28-2016, 07:21 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,702
Hwona is on a distinguished road
Default

Quote:
Originally Posted by FounderSim View Post
See previous post, what I posted about Wallie.

Code I replaced with mine. I added a $safelist array and checked if in it.
Code:
class MyadoptsController extends AppController{

    const PARAM = "aid";
    const PARAM2 = "confirm";
	private $safelist = array("page1", "page2", "page3");
	private $adopt;
	private $image;

    public function __construct(){
        parent::__construct("member");
		$mysidia = Registry::get("mysidia");

		if(!in_array($this->action, $this->safelist))
		{
			if( $this->action != "index"){
				try{
					$this->adopt = new OwnedAdoptable($mysidia->input->get("aid"));	
					if($this->adopt->getOwner() != $mysidia->user->username) throw new NoPermissionException("permission");		
					$this->image = $this->adopt->getImage("gui");
				}
				catch(AdoptNotfoundException $pne){
					$this->setFlags("nonexist_title", "nonexist");
				}              			
			}
		}
    }
Umm, have you tried just checking the page action in the 'if' condition? So... if($this->action != "index" && $this->action != "Page 1"....)
Other than that, I really have no idea as to what could possibly have gone wrong. I'm assuming everything works fine if you revert the file to its original state? :L
Reply With Quote