Adress PR's comment

This commit is contained in:
Nicolas Le Goff
2013-06-11 18:24:17 +02:00
parent 666ecc5152
commit d3716088e1
5 changed files with 11 additions and 15 deletions

View File

@@ -48,8 +48,6 @@ class Minifier implements ControllerProviderInterface
// may cause js errors // may cause js errors
$min_serveOptions['debug'] = false; $min_serveOptions['debug'] = false;
$min_serveOptions['maxAge'] = 0; $min_serveOptions['maxAge'] = 0;
$min_serveOptions['lastModifiedTime'] = $request->server->get('REQUEST_TIME');
$min_cachePath = null;
} else { } else {
$min_serveOptions['debug'] = false; $min_serveOptions['debug'] = false;
$min_serveOptions['maxAge'] = 1800; $min_serveOptions['maxAge'] = 1800;

View File

@@ -194,10 +194,7 @@ class Login implements ControllerProviderInterface
'collection' => _('Collection'), 'collection' => _('Collection'),
)); ));
$date = new \DateTime(); $response->setExpires(new \DateTime('+1 day'));
$date->modify('+1 day');
$response->setExpires($date);
return $response; return $response;
} }

View File

@@ -152,7 +152,8 @@ define([
alphaDashRegex : /^[a-z0-9_\-]+$/i, alphaDashRegex : /^[a-z0-9_\-]+$/i,
naturalRegex : /^[0-9]+$/i, naturalRegex : /^[0-9]+$/i,
naturalNoZeroRegex : /^[1-9][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})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){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[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]+$/, numericDashRegex : /^[\d\-\s]+$/,
urlRegex : /^((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/ urlRegex : /^((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/
}; };

View File

@@ -397,13 +397,6 @@ define([
this.validator.getErrors().length.should.equal(1); 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([{ this.validator.validate([{
name :"valid_ip", name :"valid_ip",
value: "1234.12.12" value: "1234.12.12"
@@ -426,6 +419,13 @@ define([
}]); }]);
this.validator.getErrors().length.should.equal(0); 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() { it("should detect an error if field value 'valid_url' is not a valid http url", function() {