Before 1fe943d6f1,
afterFind() is called twice with belongsTo/hasOne associations.
Although $results also doesn't contain associated records on first time,
it contains them on second time.
After 1fe943d6f1,
it doesn't work if associated records are used in afterFind.
This commit fixes it.
When reflecting timestamp columns in MySQL current_timestamp comes back
as the default value. This causes insertion errors later on as
'current_timestamp' is an invalid value for timestamp columns.
Refs #4184
RuntimeException is thrown at race condition.
However, since for the processing at Garbage Collection, other processes
is determined that the expired.
this process is acceptable to ignore the RuntimeException even if there is
missing file.
Abstracts the `require_once` of the schema file so it can be done twice. The added second call is a fallback for the previous APP_DIR-based naming to provide backwards compatibility.
Removes now-obsolete CakeSchema tests that involved `Configure::read('App.dir')`. The CakeSchema::name is now always static (and predictable) in the default case.
Instead of using the `APP_DIR` constant, which may change between developer installations of a project and cause issues loading Schemas generated elsewhere, use a fixed string, 'App'.
This is related to CakeDC/migrations#184 and should fully resolve#4174.
Addresses **part** of the problem described in #4174.
Corrects SchemaShell's startup logic so that when a `--file` param is provided by the user, it is always used even in the case that it matches the default file name (schema.php). This solves a problem when a user wishes to provide a classname using `--name`, but still wants to use the default filename.
When conditions are empty we can assume one of two things:
* The person made a mistake.
* The person is doing the join conditions in the where clause.
In both cases we should attempt to generate proper SQL.
Fixes#4189
PhpStorm is flagging this function as missing a return statement. Using a return statement (instead of the default) makes the intent of the source code clearer.
Eg:
Actual Posted URL:
/admin/settings/settings/prefix/Access%20Control
$_GET value:
/admin/settings/settings/prefix/Access_Control
Since $unsetUrl differs, the $_GET value will get copied in to
CakeRequest::$query, causing CakeRequest::here() to return:
/admin/settings/settings/prefix/Access%20Control?%2Fadmin%2Fsettings%2Fsettings%2Fprefix%2FAccess_Control=
This confuses SecurityComponent in the following line:
f23d811ff5/lib/Cake/Controller/Component/SecurityComponent.php (L514)
Instead of turning on/off strict mode based on the user supplied input,
cast everything to strings and always use a strict check. This avoids
the potential issue of a bad user using hexadecimal when they should not
be allowed to do so. Thanks to 'Kurita Takashi' for pointing this out.
'Kurita Takashi' has let us know that the previous patterns could be
abused by an evil doer. One could potentially send a very large deeply
nested POST data structure. Matching that structure could overflow the
PCRE limits causing a segmentation fault. Adding an upper bound will
solve the problem and I doubt anyone is doing POST data structures with
more than 10 levels of nesting.
If a model class does not define a schemaName we should use the
datasource's schemaName. We can assume that people using schemaName want
to lock the model onto a specific schema given the changes in #3210Fixes#3720
Revert "No truncate when drop table."
Not truncating tables when they are created causes a number of
issues in ControllerTestCases as indicated by the comments in #3646 post merge.
While filter_var() allows a number of email addresses that
Validation::email() does not, it misses out of email address that
contain IDN host names, and unicode mailboxes. Both of these are
generally deliverable, and should be permitted. filter_var() also fails
on local mailboxes like `root@localhost` which is useful in the context
of cron jobs.
Fixes#3742
From php.net/exception.getcode
> Returns the exception code as integer in Exception but possibly as other type in Exception descendants (for example as string in PDOException).