Fixing default extension parsing behavior for Router::parseExtensions()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4432 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-02-03 23:10:03 +00:00
parent 4c25103751
commit ed2b697999

View file

@ -62,11 +62,11 @@ class Router extends Overloadable {
*/ */
var $__parseExtensions = false; var $__parseExtensions = false;
/** /**
* Array of valid extensions to parse from a url * List of valid extensions to parse from a URL. If null, any extension is allowed.
* *
* @var boolean * @var array
*/ */
var $__validExtensions = array(); var $__validExtensions = null;
/** /**
* 'Constant' regular expression definitions for named route elements * 'Constant' regular expression definitions for named route elements
* *
@ -261,7 +261,7 @@ class Router extends Overloadable {
if ($_this->__parseExtensions) { if ($_this->__parseExtensions) {
if(preg_match('/\.[0-9a-zA-Z]*$/', $url, $match) == 1) { if(preg_match('/\.[0-9a-zA-Z]*$/', $url, $match) == 1) {
$match = substr($match[0], 1); $match = substr($match[0], 1);
if(is_null($_this->__validExtensions)) { if(empty($_this->__validExtensions)) {
$url = substr($url, 0, strpos($url, '.' . $match)); $url = substr($url, 0, strpos($url, '.' . $match));
$ext = $match; $ext = $match;
} else { } else {