File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed
Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -2750,20 +2750,19 @@ protected function sanitizePKCriteria($className, &$criteria) {
27502750 if (is_scalar ($ criteria )) {
27512751 $ pkType = $ this ->getPKType ($ className );
27522752 if (is_string ($ pkType )) {
2753- if (is_string ($ criteria ) && !xPDOQuery::isValidClause ($ criteria )) {
2754- $ criteria = null ;
2755- } else {
2756- switch ($ pkType ) {
2757- case 'int ' :
2758- case 'integer ' :
2759- $ criteria = (int )$ criteria ;
2760- break ;
2761- case 'string ' :
2762- if (is_int ($ criteria )) {
2763- $ criteria = (string )$ criteria ;
2764- }
2753+ $ pk = $ this ->getPK ($ className );
2754+ switch ($ pkType ) {
2755+ case 'int ' :
2756+ case 'integer ' :
2757+ if (!is_numeric ($ criteria )) {
2758+ $ criteria = null ;
27652759 break ;
2766- }
2760+ }
2761+ $ criteria = [$ pk => (int )$ criteria ];
2762+ break ;
2763+ case 'string ' :
2764+ $ criteria = [$ pk => (string )$ criteria ];
2765+ break ;
27672766 }
27682767 } elseif (is_array ($ pkType )) {
27692768 $ criteria = null ;
You can’t perform that action at this time.
0 commit comments