Permalink
Browse files

Possible fix for isUnique backward compatibility

  • Loading branch information...
rchavik committed Oct 13, 2014
1 parent dc7b8cb commit dcb605c700257d90ebb972c85132adece9271ced
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/Cake/Model/Model.php
View
@@ -3302,9 +3302,12 @@ public function resetAssociations() {
*/
public function isUnique($fields, $or = true) {
if (is_array($or)) {
- $args = func_get_args();
- $fields = $args[1];
- $or = isset($args[2]) ? $args[2] : true;
+ $isAssociative = count(array_filter(array_keys($or), 'is_string'));
+ if (!$isAssociative) {
+ $args = func_get_args();
+ $fields = $args[1];
+ $or = isset($args[2]) ? $args[2] : true;
+ }
}
if (!is_array($fields)) {
$fields = func_get_args();

0 comments on commit dcb605c

Please sign in to comment.