Changeset 11202
- Timestamp:
- 08/27/08 17:08:56 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2/lib/controller/sfWebController.class.php
r9956 r11202 32 32 { 33 33 // absolute URL or symfony URL? 34 if ( !is_array($parameters) && preg_match('#^[a-z][a-z0-9\+.\-]*\://#i', $parameters))34 if (is_string($parameters) && preg_match('#^[a-z][a-z0-9\+.\-]*\://#i', $parameters)) 35 35 { 36 36 return $parameters; 37 37 } 38 38 39 if ( !is_array($parameters) && $parameters == '#')39 if (is_string($parameters) && $parameters == '#') 40 40 { 41 41 return $parameters; … … 53 53 $fragment = ''; 54 54 55 if ( !is_array($parameters))55 if (is_string($parameters)) 56 56 { 57 57 // strip fragment … … 63 63 64 64 list($route_name, $parameters) = $this->convertUrlStringToParameters($parameters); 65 } 66 else if (is_array($parameters)) 67 { 68 if (isset($parameters['sf_route'])) 69 { 70 $route_name = $parameters['sf_route']; 71 unset($parameters['sf_route']); 72 } 65 73 } 66 74 branches/1.2/test/unit/controller/sfWebControllerTest.php
r9956 r11202 170 170 // ->genUrl() 171 171 $t->diag('->genUrl()'); 172 173 $r = $context->getRouting();174 172 $t->is($controller->genUrl('module/action?id=4'), $controller->genUrl(array('action' => 'action', 'module' => 'module', 'id' => 4)), '->genUrl() accepts a string or an array as its first argument'); 175 173 … … 203 201 $t->is($controller->genUrl('module/action'), $relativeUrlRoot.$_SERVER['SCRIPT_NAME'].$referenceUrl, '->genUrl() with a relative_url_root set and no_script_name==false'); 204 202 $t->is($controller->genUrl('@test'), $relativeUrlRoot.$_SERVER['SCRIPT_NAME'].$referenceRootUrl, '->genUrl() with a relative_url_root set and no_script_name==false (root url)'); 205

