Issues

ZF-9859: Redirector::gotoUrlAndExit() should call setGotoUrl() instead of gotoUrl()

Issue Type: Bug Created: 2010-05-19T10:39:24.000+0000 Last Updated: 2010-11-20T09:25:39.000+0000 Status: Resolved Fix version(s): - 1.11.0 (02/Nov/10)

Reporter: David Harkness (dharkness) Assignee: Michelangelo van Dam (dragonbe) Tags: - Zend_Controller

Related issues: Attachments:

Description

Two of the three gotoXXXAndExit() functions call the setGotoXXX() just as their gotoXXX() counterparts do, but the third one, gotoUrlAndExit(), calls its gotoUrl() counterpart instead. While the code works fine since gotoUrl() calls setGotoUrl() itself, and if the call to getExit() returns true, redirectAndExit() is called which gotoUrlAndExit() does itself anyway, it is clearly a copy-and-paste error and should be fixed for consistency.

Here's the normal pattern:

<pre class="highlight">
doAandMaybeB():
  doA()
  if shouldDoB():
    doB()

doAandB():
  doA()
  doB()

Here's the broken pattern that gotoUrlAndExit() uses:

<pre class="highlight">
doAandB():
  doAandMaybeB()  // <-- should be doA()
  doB()

I'm running 1.9.4 but checked the latest revision using the code browser:

<a rel="nofollow" href="http://framework.zend.com/code/browse/~raw,r=20096/Zend_Framework/standard/trunk/library/Zend/Controller/Action/Helper/Redirector.php">http://framework.zend.com/code/browse/&hellip;</a>

Comments

Posted by Michelangelo van Dam (dragonbe) on 2010-09-17T14:08:59.000+0000

tested it and changed it in r22957

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts