Skip to content

Commit

Permalink
fix php 8 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
theDyingMountain committed Mar 27, 2023
1 parent f702202 commit f6a215d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
31 changes: 17 additions & 14 deletions dca/tl_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,23 @@ public function checkFileSize(DataContainer $dc) {
$pictureLeft = \FilesModel::findByUuid($dc->activeRecord->pictureLeftSRC);
$pictureRight = \FilesModel::findByUuid($dc->activeRecord->pictureRightSRC);

list($pictureLeftWidth, $pictureLeftHeight) = getimagesize("../".$pictureLeft->path);
list($pictureRightWidth, $pictureRightHeight) = getimagesize("../".$pictureRight->path);

if ($pictureLeftWidth !== $pictureRightWidth || $pictureLeftHeight !== $pictureRightHeight) {
Message::addError("Die Dimensionen (Breite, Höhe) der Bilder stimmen nicht überein!");
$dc->activeRecord->pictureLeftSRC = null;
$dc->activeRecord->pictureRightSRC = null;

$this->Database->query("UPDATE tl_content SET pictureLeftSRC=null, pictureRightSRC=null WHERE id=".$dc->activeRecord->id);

unset($_POST['saveNclose']);
unset($_POST['saveNback']);
unset($_POST['saveNcreate']);
unset($_POST['saveNedit']);
if (!empty($pictureLeft) && !empty($pictureRight)) {
list($pictureLeftWidth, $pictureLeftHeight) = getimagesize("../".$pictureLeft->path);
list($pictureRightWidth, $pictureRightHeight) = getimagesize("../".$pictureRight->path);


if ($pictureLeftWidth !== $pictureRightWidth || $pictureLeftHeight !== $pictureRightHeight) {
Message::addError("Die Dimensionen (Breite, Höhe) der Bilder stimmen nicht überein!");
$dc->activeRecord->pictureLeftSRC = null;
$dc->activeRecord->pictureRightSRC = null;

$this->Database->query("UPDATE tl_content SET pictureLeftSRC=null, pictureRightSRC=null WHERE id=".$dc->activeRecord->id);

unset($_POST['saveNclose']);
unset($_POST['saveNback']);
unset($_POST['saveNcreate']);
unset($_POST['saveNedit']);
}
}
}

Expand Down
6 changes: 4 additions & 2 deletions elements/ContentComparisonSlider.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ protected function compile() {

$this->Template->classNames .= "ce_comparison-slider ";

foreach ($this->Template->classes as $class) {
$this->Template->classNames .= $class." ";
if (!empty($this->Template->classes)) {
foreach ($this->Template->classes as $class) {
$this->Template->classNames .= $class." ";
}
}

if (isset($this->pictureLeftSRC) && isset($this->pictureRightSRC)) {
Expand Down

0 comments on commit f6a215d

Please sign in to comment.