Comments (1)
Thanks for reporting this. There's not really any active Kohana development any longer, though if you want to PR a fix we'd take a look.
Personally, I don't think Valid::date should ever have been accepting timestamp arguments : strtotime's parsing of them is not what you'd expect:
php > $str = 1500422400;
php > print date('Y-m-d H:i:s', $str)."\n";
2017-07-19 01:00:00
php > print strtotime($str)."\n";
13586799642
php > print date('Y-m-d H:i:s', strtotime($str))."\n";
2400-07-19 15:00:42
php > print_r(new \DateTime($str));
DateTime Object
(
[date] => 2400-07-19 15:00:42
[timezone_type] => 3
[timezone] => Europe/London
)
It's not recognising it as a timestamp, but as a time followed by a partial date. The 1499385600
fails because 14:99
isn't a valid time.
So, even if Valid::date accepted timestamps reliably, it wouldn't be safe to handle them in your application unless you knew that's what they were and treated them differently to a date string.
If you actually want to accept only timestamps then I'd suggest validating as an integer within a suitable range, and explicitly treating as a timestamp in your application code.
If you want to accept date strings, then potentially it's better to use a custom date validator that's more restrictive about the formats it accepts.
from core.
Related Issues (20)
- Use of mikey179/vfsStream for Log tests breaks module builds HOT 3
- 3.4.0 current status HOT 49
- Change detecting urls starting with //
- Improvements on website HOT 10
- 1 repo to rule them all HOT 12
- .git files in modules release for 3.3.5 HOT 4
- 4.0.0 release HOT 16
- Ubuntu packages HOT 9
- modules and composer - play together nicer HOT 2
- Should we remove 'action', 'controller', 'directory' from request params? HOT 4
- Implementation of external requests in Minion Task HOT 5
- [Security] Encrypt HOT 34
- Issues with PHP 7.0.6 and ORM HOT 3
- Use Route:url in Minion Task HOT 1
- ERROR: Kohana_Exception [ 0 ]: Directory APPPATH/cache must be writable HOT 8
- "content-length" -header calculation in Response
- Server Upgraded to PHP7 Error: __toString() must not throw an exception HOT 4
- Error en Core Handle
- [Proposal] Make middlewares HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.