fixes#12840
Used @nkovacs draft as starting
point(https://github.com/yiisoft/yii2/issues/11037#issuecomment-193356450).
I also fixed some bugs in `yii.validation.js` and did some refactoring.
Implemented tests:
- yii.validation.js
Running tests:
- Install Node.js. I used the latest version available at the moment -
`v7.1.0`. Note that used `jsdom` dependent library version requires
`Node.js >= 4`.
- Run `npm install` to install dependencies.
- Execute `npm test` for running tests.
* prepare-travis-for-js:
remove CUBRID env from travis it is unused
Install APC on Ubuntu trusty
Fix MySQL database setup for ubuntu trusty
Switch travis OR from precise to trusty
Switch from precise to trusty is required mainly because of jsdom
dependency. It requires Node.js > 4. Precise has very old Node.js and
NPM versions and they can not be updated because of default versions of
C++ compilers. While it's possible somehow to install Node 6 on Precise,
see this [document](https://github.com/nodesource/distributions/blob/master/OLDER_DISTROS.md),
I think this is not elegant solution and I'm not 100%
sure it will work correctly with Travis and container-based precise dist.
Trusty has v6.3.0 by default which is enough and way better and newer.
Changed timestamp mapping to datetime on MSSQL.
Timestamp is a unique number on MSSQL, not a timestamp.
> https://msdn.microsoft.com/en-us/library/ms182776(v=SQL.90).aspx
> The timestamp data type is just an incrementing number and does not
> preserve a date or a time. To record a date or time, use a datetime data type.
separated from #9191close#9305
* Added documentation about Host header attack
Added info about Host header attack (#13050) to the guide and the Request class.
When we introduce a filter or property to protect against this, these
sections should be updated to link to that option.
In MSIE8 and below, yii.gridView file is not loaded and GridView widget is not working (throws Identifier expected error). The reason is that the variable name 'class' is a reserved word. To correct this, the variable name should be changed into an array key, which eliminates the error.
More info about the causes of error: https://tiffanybbrown.com/2013/09/10/expected-identifier-bug-in-internet-explorer-8/