Browse Source

PHP code style adjustments

Tobias Reich 8 years ago
parent
commit
9e76acd9a8
2 changed files with 6 additions and 5 deletions
  1. 3 2
      php/modules/Photo.php
  2. 3 3
      php/modules/Session.php

+ 3 - 2
php/modules/Photo.php

@@ -18,6 +18,7 @@ class Photo extends Module {
 		IMAGETYPE_GIF,
 		IMAGETYPE_PNG
 	);
+
 	public static $validExtensions = array(
 		'.jpg',
 		'.jpeg',
@@ -125,7 +126,7 @@ class Photo extends Module {
 
 			# Verify extension
 			$extension = getExtension($file['name']);
-			if (!in_array(strtolower($extension), Photo::$validExtensions, true)) {
+			if (!in_array(strtolower($extension), self::$validExtensions, true)) {
 				Log::error($this->database, __METHOD__, __LINE__, 'Photo format not supported');
 				if ($returnOnError===true) return false;
 				exit('Error: Photo format not supported!');
@@ -133,7 +134,7 @@ class Photo extends Module {
 
 			# Verify image
 			$type = @exif_imagetype($file['tmp_name']);
-			if (!in_array($type, Photo::$validTypes, true)) {
+			if (!in_array($type, self::$validTypes, true)) {
 				Log::error($this->database, __METHOD__, __LINE__, 'Photo type not supported');
 				if ($returnOnError===true) return false;
 				exit('Error: Photo type not supported!');

+ 3 - 3
php/modules/Session.php

@@ -40,6 +40,9 @@ class Session extends Module {
 		# Return settings
 		$return['config'] = $this->settings;
 
+		# Path to Lychee for the server-import dialog
+		$return['config']['location'] = LYCHEE;
+
 		# Remove username and password from response
 		unset($return['config']['username']);
 		unset($return['config']['password']);
@@ -47,9 +50,6 @@ class Session extends Module {
 		# Remove identifier from response
 		unset($return['config']['identifier']);
 
-		# Path to Lychee for the server-import dialog
-		$return['config']['location'] = LYCHEE;
-
 		# Check if login credentials exist and login if they don't
 		if ($this->noLogin()===true) {
 			$public = false;