Index: tests/Zend/Controller/Action/Helper/RedirectorTest.php =================================================================== --- tests/Zend/Controller/Action/Helper/RedirectorTest.php (revision 10762) +++ tests/Zend/Controller/Action/Helper/RedirectorTest.php (working copy) @@ -114,7 +114,25 @@ } catch (Exception $e) { } } + + public function testCodeAsAStringIsAllowed() + { + $this->redirector->setCode('303'); + $this->assertEquals(303, $this->redirector->getCode()); + + try { + $this->redirector->setCode('251'); + $this->fail('Invalid redirect code should throw exception'); + } catch (Exception $e) { + } + try { + $this->redirector->setCode('351'); + $this->fail('Invalid redirect code should throw exception'); + } catch (Exception $e) { + } + } + public function testExit() { $this->assertFalse($this->redirector->getExit()); Index: library/Zend/Controller/Action/Helper/Redirector.php =================================================================== --- library/Zend/Controller/Action/Helper/Redirector.php (revision 10762) +++ library/Zend/Controller/Action/Helper/Redirector.php (working copy) @@ -88,7 +88,10 @@ */ protected function _checkCode($code) { - if (!is_int($code) || (300 > $code) || (307 < $code)) { + if (is_string($code) && $code == intval($code)) { + $code = (int)$code; + } + if ((300 > $code) || (307 < $code)) { /** * @see Zend_Controller_Exception */