mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Fix folder urls getting mtime querystring appended
This commit is contained in:
parent
741166e369
commit
8078ee08f2
@ -2,6 +2,7 @@
|
||||
|
||||
namespace SilverStripe\Control;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use SilverStripe\Core\Manifest\ResourceURLGenerator;
|
||||
|
||||
/**
|
||||
@ -30,6 +31,7 @@ class SimpleResourceURLGenerator implements ResourceURLGenerator
|
||||
* Currently only "mtime" is allowed
|
||||
*
|
||||
* @param string|null $nonceStyle The style of nonces to apply, or null to disable
|
||||
* @return $this
|
||||
*/
|
||||
public function setNonceStyle($nonceStyle)
|
||||
{
|
||||
@ -37,6 +39,7 @@ class SimpleResourceURLGenerator implements ResourceURLGenerator
|
||||
throw new InvalidArgumentException('The only allowed NonceStyle is mtime');
|
||||
}
|
||||
$this->nonceStyle = $nonceStyle;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -55,7 +58,8 @@ class SimpleResourceURLGenerator implements ResourceURLGenerator
|
||||
}
|
||||
|
||||
$nonce = '';
|
||||
if ($this->nonceStyle) {
|
||||
// Don't add nonce to directories
|
||||
if ($this->nonceStyle && is_file($absolutePath)) {
|
||||
$nonce = (strpos($relativePath, '?') === false) ? '?' : '&';
|
||||
|
||||
switch ($this->nonceStyle) {
|
||||
|
Loading…
Reference in New Issue
Block a user