File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1515 "require" : {
1616 "php" : " >=7.1" ,
1717 "guzzlehttp/guzzle" : " ^6.2" ,
18- "monolog/monolog" : " ^1.22" ,
1918 "nesbot/carbon" : " ^1.22" ,
2019 "illuminate/support" : " ^5.4"
2120 },
Original file line number Diff line number Diff line change @@ -285,9 +285,9 @@ protected function whereBasic(Builder $query, $where)
285285 //$value = $this->parameter($where['value']);
286286 $ value = $ where ['value ' ];
287287
288- // stringify all values if it has NOT an odata enum syntax
289- // (ex. Microsoft.OData.SampleService.Models.TripPin.PersonGender'Female')
290- if (!preg_match ("/^([\w]+\.)+([\w]+)(\'[\w]+\')$/ " , $ value )) {
288+ // stringify all values if it has NOT an odata enum or special syntax primitive data type
289+ // (ex. Microsoft.OData.SampleService.Models.TripPin.PersonGender'Female' or datetime'1970-01-01T00:00:00' )
290+ if (!preg_match ("/^([\w]+\.)+([\w]+)(\'[\w]+\')$/ " , $ value ) && ! $ this -> isSpecialPrimitiveDataType ( $ value ) ) {
291291 // Check if the value is a string and NOT a date
292292 if (is_string ($ value ) && !\DateTime::createFromFormat ('Y-m-d\TH:i:sT ' , $ value )) {
293293 $ value = "' " .$ where ['value ' ]."' " ;
@@ -297,6 +297,10 @@ protected function whereBasic(Builder $query, $where)
297297 return $ where ['column ' ].' ' .$ this ->getOperatorMapping ($ where ['operator ' ]).' ' .$ value ;
298298 }
299299
300+ protected function isSpecialPrimitiveDataType ($ value ){
301+ return preg_match ("/^(binary|datetime|guid|time|datetimeoffset)(\'[\w\:\-\.]+\')$/i " , $ value );
302+ }
303+
300304 /**
301305 * Compile the "order by" portions of the query.
302306 *
You can’t perform that action at this time.
0 commit comments