Fixing querystring parameters being chopped off of absolute webroot asset paths.

This commit is contained in:
Mark Story 2010-02-13 20:43:02 -05:00
parent 6ccc43d776
commit f04add4f79
2 changed files with 14 additions and 10 deletions

View file

@ -224,7 +224,7 @@ class Helper extends Overloadable {
}
}
if (strpos($webPath, '//') !== false) {
return str_replace('//', '/', $webPath);
return str_replace('//', '/', $webPath . $asset[1]);
}
return $webPath . $asset[1];
}

View file

@ -697,6 +697,10 @@ class HelperTest extends CakeTestCase {
$expected = '/img/cake.icon.gif';
$this->assertEqual($result, $expected);
$result = $this->Helper->webroot('/img/cake.icon.gif?some=param');
$expected = '/img/cake.icon.gif?some=param';
$this->assertEqual($result, $expected);
Configure::write('App.www_root', $webRoot);
}