diff --git a/library/Zend/Dojo/View/Helper/Dojo/Container.php b/library/Zend/Dojo/View/Helper/Dojo/Container.php index 705e570f1a..31a89a62b1 100644 --- a/library/Zend/Dojo/View/Helper/Dojo/Container.php +++ b/library/Zend/Dojo/View/Helper/Dojo/Container.php @@ -430,7 +430,7 @@ public function getCdnBase() public function setCdnVersion($version = null) { $this->enable(); - if (preg_match('/^[1-9]\.[0-9](\.[0-9])?$/', $version)) { + if (preg_match('/^[1-9]\.[0-9]{1,2}(\.[0-9]{1,2})?$/', $version)) { $this->_cdnVersion = $version; } return $this; diff --git a/tests/Zend/Dojo/View/Helper/DojoTest.php b/tests/Zend/Dojo/View/Helper/DojoTest.php index aab4e9953a..5344394ebc 100644 --- a/tests/Zend/Dojo/View/Helper/DojoTest.php +++ b/tests/Zend/Dojo/View/Helper/DojoTest.php @@ -235,6 +235,24 @@ public function testShouldAllowSpecifyingDojoVersionWhenUtilizingCdn() $this->assertEquals('1.0', $this->helper->getCdnVersion()); } + /** + * @group GH-488 + */ + public function testSetCdnVersionForHigherMinorReleases() + { + $this->helper->setCdnVersion('1.10'); + $this->assertEquals('1.10', $this->helper->getCdnVersion()); + } + + /** + * @group GH-488 + */ + public function testSetCdnVersionForHigherMiniReleases() + { + $this->helper->setCdnVersion('1.10.29'); + $this->assertEquals('1.10.29', $this->helper->getCdnVersion()); + } + public function testShouldUseAolCdnDojoPathByDefault() { $this->assertEquals(Zend_Dojo::CDN_DOJO_PATH_AOL, $this->helper->getCdnDojoPath());