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;
|
namespace SilverStripe\Control;
|
||||||
|
|
||||||
|
use InvalidArgumentException;
|
||||||
use SilverStripe\Core\Manifest\ResourceURLGenerator;
|
use SilverStripe\Core\Manifest\ResourceURLGenerator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,6 +31,7 @@ class SimpleResourceURLGenerator implements ResourceURLGenerator
|
|||||||
* Currently only "mtime" is allowed
|
* Currently only "mtime" is allowed
|
||||||
*
|
*
|
||||||
* @param string|null $nonceStyle The style of nonces to apply, or null to disable
|
* @param string|null $nonceStyle The style of nonces to apply, or null to disable
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setNonceStyle($nonceStyle)
|
public function setNonceStyle($nonceStyle)
|
||||||
{
|
{
|
||||||
@ -37,6 +39,7 @@ class SimpleResourceURLGenerator implements ResourceURLGenerator
|
|||||||
throw new InvalidArgumentException('The only allowed NonceStyle is mtime');
|
throw new InvalidArgumentException('The only allowed NonceStyle is mtime');
|
||||||
}
|
}
|
||||||
$this->nonceStyle = $nonceStyle;
|
$this->nonceStyle = $nonceStyle;
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,7 +58,8 @@ class SimpleResourceURLGenerator implements ResourceURLGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
$nonce = '';
|
$nonce = '';
|
||||||
if ($this->nonceStyle) {
|
// Don't add nonce to directories
|
||||||
|
if ($this->nonceStyle && is_file($absolutePath)) {
|
||||||
$nonce = (strpos($relativePath, '?') === false) ? '?' : '&';
|
$nonce = (strpos($relativePath, '?') === false) ? '?' : '&';
|
||||||
|
|
||||||
switch ($this->nonceStyle) {
|
switch ($this->nonceStyle) {
|
||||||
|
Loading…
Reference in New Issue
Block a user