IdoQuery: Fix method isTimestamp() not handling customvars properly

refs #10316
This commit is contained in:
Johannes Meyer 2015-11-13 12:13:02 +01:00
parent d0ab001437
commit 005ec27cea
1 changed files with 7 additions and 6 deletions

View File

@ -546,16 +546,17 @@ abstract class IdoQuery extends DbQuery
/** /**
* Return true if an field contains an explicit timestamp * Return true if an field contains an explicit timestamp
* *
* @param String $field The field to test for containing an timestamp * @param string $field The field to test for containing an timestamp
* @return bool True when the field represents an timestamp *
* @return bool True when the field represents an timestamp
*/ */
public function isTimestamp($field) public function isTimestamp($field)
{ {
$mapped = $this->getMappedField($field); if ($this->isCustomVar($field)) {
if ($mapped === null) { return false;
return stripos($field, 'UNIX_TIMESTAMP') !== false;
} }
return stripos($mapped, 'UNIX_TIMESTAMP') !== false;
return stripos($this->getMappedField($field) ?: $field, 'UNIX_TIMESTAMP') !== false;
} }
/** /**