From dca8b5555d577869c455110e10602367cbc1daf5 Mon Sep 17 00:00:00 2001 From: Matthias Gutjahr Date: Mon, 7 Dec 2015 22:44:42 +0100 Subject: [PATCH] Set undefined vars, remove unused vars nad code that cannot be reached. --- php/access/Guest.php | 4 ++-- php/modules/Album.php | 2 +- php/modules/Database.php | 1 + php/modules/Import.php | 1 - php/modules/Photo.php | 7 +------ php/modules/Plugins.php | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/php/access/Guest.php b/php/access/Guest.php index cbb06ae..611d310 100644 --- a/php/access/Guest.php +++ b/php/access/Guest.php @@ -33,7 +33,7 @@ class Guest extends Access { # Error default: exit('Error: Function not found! Please check the spelling of the called function.'); - return false; break; + break; } @@ -177,4 +177,4 @@ class Guest extends Access { } -?> \ No newline at end of file +?> diff --git a/php/modules/Album.php b/php/modules/Album.php index a04dcac..708dab1 100644 --- a/php/modules/Album.php +++ b/php/modules/Album.php @@ -195,7 +195,7 @@ class Album extends Module { # Execute query $albums = $this->database->query($query); if (!$albums) { - Log::error($database, __METHOD__, __LINE__, 'Could not get all albums (' . $database->error . ')'); + Log::error($this->database, __METHOD__, __LINE__, 'Could not get all albums (' . $this->database->error . ')'); exit('Error: ' . $this->database->error); } diff --git a/php/modules/Database.php b/php/modules/Database.php index 280de73..d7764e4 100755 --- a/php/modules/Database.php +++ b/php/modules/Database.php @@ -277,6 +277,7 @@ if(!defined('LYCHEE')) exit('Error: Direct access is not allowed!'); # This avoids problems with placeholders in user-input # $skip = Number of placeholders which need to be skipped $skip = 0; + $temp = ''; $num = array( 'placeholder' => substr_count($query, '?'), 'data' => count($data) diff --git a/php/modules/Import.php b/php/modules/Import.php index 1872bbe..621c562 100644 --- a/php/modules/Import.php +++ b/php/modules/Import.php @@ -11,7 +11,6 @@ class Import extends Module { private $database = null; private $settings = null; - private $albumIDs = null; public function __construct($database, $plugins, $settings) { diff --git a/php/modules/Photo.php b/php/modules/Photo.php index 1035f21..bc745dd 100755 --- a/php/modules/Photo.php +++ b/php/modules/Photo.php @@ -486,8 +486,6 @@ class Photo extends Module { if (extension_loaded('imagick')&&$this->settings['imagick']==='1') { - $rotateImage = 0; - switch ($info['orientation']) { case 3: @@ -535,7 +533,6 @@ class Photo extends Module { break; case 3: - $process = true; $sourceImg = imagerotate($sourceImg, -180, 0); break; @@ -552,7 +549,6 @@ class Photo extends Module { break; case 6: - $process = true; $sourceImg = imagerotate($sourceImg, -90, 0); $newWidth = $info['height']; $newHeight = $info['width']; @@ -566,7 +562,6 @@ class Photo extends Module { break; case 8: - $process = true; $sourceImg = imagerotate($sourceImg, 90, 0); $newWidth = $info['height']; $newHeight = $info['width']; @@ -1251,4 +1246,4 @@ class Photo extends Module { } -?> \ No newline at end of file +?> diff --git a/php/modules/Plugins.php b/php/modules/Plugins.php index 1cca42b..9663814 100644 --- a/php/modules/Plugins.php +++ b/php/modules/Plugins.php @@ -20,7 +20,6 @@ class Plugins implements \SplSubject { if (!isset($files)) return false; # Init vars - $plugins = $this; $this->files = $files; # Load plugins @@ -92,4 +91,4 @@ class Plugins implements \SplSubject { } -?> \ No newline at end of file +?>