$_REQUEST conversion

Cupara

Well-known member
Licensed customer
Ok yes I am working on XFArcade and I can't stand not figuring this out. I thought by changing $_REQUEST to $this->getRequest() that would fix the issue which it did but then the redirect from the game on saving the score stopped working, if I revert then the score part redirects and gives an error. So here is the file using autocom:
PHP:
class Arcade_Extend_ControllerPublic_Index extends XFCP_Arcade_Extend_ControllerPublic_Index {
    public function actionIndex() {
        if ($this->getRequest('autocom') == 'arcade') {
            // TODO: use filterSingle here?
            switch ($this->getRequest()->getParam('do')) {
                case 'verifyscore':
                    return $this->responseReroute('Arcade_ControllerPublic_Arcade', 'IpbVerifyScore');
                case 'savescore':
                    return $this->responseReroute('Arcade_ControllerPublic_Arcade', 'IpbSaveScore');
                default:
                    return $this->responseNoPermission();
            }
        } else {
            return parent::actionIndex();
        }
    }
    
    protected function _checkCsrf($action) {
        if ($this->getRequest('autocom') == 'arcade') {
            self::$_executed['csrf'] = true;
            return true;
        } else {
            return parent::_checkCsrf($action);
        }
    }
}

Just replace $this->getRequest() with $_REQUEST[]

Here is the Session.php line:
PHP:
        extract($this->_getScoreComparison($reversedScoring));

The error is: Only variables should be passed by reference
 
If you are calling it XFArcade, then all of your classes and file structure should be "XFArcade" and not "Arcade."
 
That is beside the point. It works using Arcade, the name is just a name, the classes are Arcade.
 
Ok ok, I will change it. Right now I have an issue to fix before anything changes. Otherwise it won't matter how I have it, the mod will break.
 
Here is the Session.php line:
PHP:
        extract($this->_getScoreComparison($reversedScoring));

The error is: Only variables should be passed by reference

That function takes a reference parameter:

http://us2.php.net/manual/en/function.extract.php

You need to pass in a variable instead of a value. For example:

Code:
$var = $this->_getScoreComparison($reversedScoring);

extract($var);
 
Thanks much Jake. Any advice on the $_REQUEST issue?

Nothing off hand. I would need to have access to your addon so I can test, debug, and fully explore what is going on. If you are comfortable giving me a copy then I can install it on my forum and have a look.
 
Back
Top Bottom