AntiWPA Forum

Full Version: Help me fix decoding error :) Thanks!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys, need help fixing error :

Fatal error: Cannot break/continue 1 level in /home/sks/public_html/skps/classes/payment.php on line 238


$this->setInfo( $lng['payments']['transaction_already_processed'] );
}
else if ( !$this->getManual( ) )
{
line 238: break;
}
else
{
FULL FUNCTION:
Code:
public function process( )
    {
        global $db;
        global $lng;
        if ( $this->payment_processor['recurring'] <= 0 || !$this->pay->isAutoRenew( ) )
        {
            $completed = $db->fetchRow( "select completed from ".TABLE_PAYMENT_ACTIONS." where ukey = '".$this->user_key."'" );
            if ( $completed )
            {
                $this->setInfo( $lng['payments']['transaction_already_processed'] );
            }
            else if ( !$this->getManual( ) )
            {
            break;
            }
            else
            {
                $exists = $db->fetchRow( "select count(*) from ".$this->pay->getRetTable( )." where ukey = '".$this->user_key."'" );
                if ( !$exists )
                {
                    //break;
                    $this->setInfo( $lng['payments']['transaction_already_processed'] );
                }
                else
                {
                break;
                }
            }
        }
        else
        {
            do
            {
                do
                {
                    $this->user_key = "";
                } while ( 0 );
            } while ( 0 );
            $success = $this->pay->process( );
            if ( $success )
            {
                if ( !$this->pending )
                {
                    $this->pending = $this->pay->getPending( );
                }
                $this->paymentDone( );
            }
            else
            {
                $this->setInfo( $lng[$this->processor]['invalid_transaction'] );
            }
        }
    }
Thanks all for helping fix that error Smile
Because you are using break without "switch...case" or looping. You can solve this by changing "break" to "return" to exit from the function.

Enjoy!!! .. all the best... Smile
Reference URL's