mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 04:53:26 +00:00
Adress PR's comment
This commit is contained in:
@@ -48,8 +48,6 @@ class Minifier implements ControllerProviderInterface
|
||||
// may cause js errors
|
||||
$min_serveOptions['debug'] = false;
|
||||
$min_serveOptions['maxAge'] = 0;
|
||||
$min_serveOptions['lastModifiedTime'] = $request->server->get('REQUEST_TIME');
|
||||
$min_cachePath = null;
|
||||
} else {
|
||||
$min_serveOptions['debug'] = false;
|
||||
$min_serveOptions['maxAge'] = 1800;
|
||||
|
@@ -194,10 +194,7 @@ class Login implements ControllerProviderInterface
|
||||
'collection' => _('Collection'),
|
||||
));
|
||||
|
||||
$date = new \DateTime();
|
||||
$date->modify('+1 day');
|
||||
|
||||
$response->setExpires($date);
|
||||
$response->setExpires(new \DateTime('+1 day'));
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
@@ -152,7 +152,8 @@ define([
|
||||
alphaDashRegex : /^[a-z0-9_\-]+$/i,
|
||||
naturalRegex : /^[0-9]+$/i,
|
||||
naturalNoZeroRegex : /^[1-9][0-9]*$/i,
|
||||
ipRegex : /^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$/i,
|
||||
// IP v6 a v4 or hostname, by Mikulas Dite see http://stackoverflow.com/a/9209720/96656
|
||||
ipRegex : /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$|^(?:(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(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(?:[0-9a-fA-F]{1,4})):){0,3}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:[0-9a-fA-F]{1,4})):)(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,4}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,5}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,6}(?:(?:[0-9a-fA-F]{1,4})))?::))))$/i,
|
||||
numericDashRegex : /^[\d\-\s]+$/,
|
||||
urlRegex : /^((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/
|
||||
};
|
||||
|
@@ -397,13 +397,6 @@ define([
|
||||
|
||||
this.validator.getErrors().length.should.equal(1);
|
||||
|
||||
this.validator.validate([{
|
||||
name :"valid_ip",
|
||||
value: "coucou"
|
||||
}]);
|
||||
|
||||
this.validator.getErrors().length.should.equal(1);
|
||||
|
||||
this.validator.validate([{
|
||||
name :"valid_ip",
|
||||
value: "1234.12.12"
|
||||
@@ -426,6 +419,13 @@ define([
|
||||
}]);
|
||||
|
||||
this.validator.getErrors().length.should.equal(0);
|
||||
|
||||
this.validator.validate([{
|
||||
name :"valid_ip",
|
||||
value: "my.domain"
|
||||
}]);
|
||||
|
||||
this.validator.getErrors().length.should.equal(0);
|
||||
});
|
||||
|
||||
it("should detect an error if field value 'valid_url' is not a valid http url", function() {
|
||||
|
Reference in New Issue
Block a user