Skip to content

Commit

Permalink
array_push, type safe comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
mambax7 committed Dec 27, 2020
1 parent 8475bac commit 0268297
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion class/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function __construct($id = null)
$this->helper = Helper::getInstance();
/** @var \XoopsMySQLDatabase $db */
$this->db = \XoopsDatabaseFactory::getDatabaseConnection();

$this->initVar('fileid', \XOBJ_DTYPE_INT, 0, false);
$this->initVar('itemid', \XOBJ_DTYPE_INT, null, true);
$this->initVar('name', \XOBJ_DTYPE_TXTBOX, null, true, 255);
Expand Down Expand Up @@ -208,7 +209,7 @@ public function getDatesub($dateFormat = 's', $format = 'S')
*/
public function notLoaded()
{
return (0 == $this->getVar('itemid'));
return (0 === $this->getVar('itemid'));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion class/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ public function getImages()
$imagesIds = \explode('|', $images);
}
if ($image > 0) {
array_push($imagesIds, $image);
$imagesIds[] = $image;
}
$imageObjs = [];
if (\count($imagesIds) > 0) {
Expand Down

0 comments on commit 0268297

Please sign in to comment.