php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #76208 Using Yaf_Response_HTTP::setRedirect in CLI mode
Submitted: 2018-04-11 11:25 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: fanjiapeng at 126 dot com Assigned:
Status: Open Package: yaf (PECL)
PHP Version: 7.2.4 OS: CentOS release 6.2 (Final)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
6 + 44 = ?
Subscribe to this entry?

 
 [2018-04-11 11:25 UTC] fanjiapeng at 126 dot com
Description:
------------
In some cases, the function is called in CLI mode. Although it does not work in CLI mode.

Test script:
---------------
<?php
class IndexController extends Yaf_Controller_Abstract
{
    public function indexAction()
    {
        Yaf_Dispatcher::getInstance()->disableView();

        $a = $b;
        
        $response = new Yaf_Response_HTTP(); 
        var_dump($response->setRedirect('https://yourdomain.com'));
    }
}

Expected result:
----------------
bool(false)

Actual result:
--------------
Notice: Undefined variable: b in /www/application/controllers/Index.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at /www/application/controllers/Index.php:8) in /www/application/controllers/Index.php on line 11
bool(false)

Patches

yaf_response_http.patch (last revision 2018-04-11 12:05 UTC by fanjiapeng at 126 dot com)

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Aug 22 14:01:26 2019 UTC