PHP code style adjustments
This commit is contained in:
parent
978caa90b3
commit
9e76acd9a8
@ -18,6 +18,7 @@ class Photo extends Module {
|
|||||||
IMAGETYPE_GIF,
|
IMAGETYPE_GIF,
|
||||||
IMAGETYPE_PNG
|
IMAGETYPE_PNG
|
||||||
);
|
);
|
||||||
|
|
||||||
public static $validExtensions = array(
|
public static $validExtensions = array(
|
||||||
'.jpg',
|
'.jpg',
|
||||||
'.jpeg',
|
'.jpeg',
|
||||||
@ -125,7 +126,7 @@ class Photo extends Module {
|
|||||||
|
|
||||||
# Verify extension
|
# Verify extension
|
||||||
$extension = getExtension($file['name']);
|
$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');
|
Log::error($this->database, __METHOD__, __LINE__, 'Photo format not supported');
|
||||||
if ($returnOnError===true) return false;
|
if ($returnOnError===true) return false;
|
||||||
exit('Error: Photo format not supported!');
|
exit('Error: Photo format not supported!');
|
||||||
@ -133,7 +134,7 @@ class Photo extends Module {
|
|||||||
|
|
||||||
# Verify image
|
# Verify image
|
||||||
$type = @exif_imagetype($file['tmp_name']);
|
$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');
|
Log::error($this->database, __METHOD__, __LINE__, 'Photo type not supported');
|
||||||
if ($returnOnError===true) return false;
|
if ($returnOnError===true) return false;
|
||||||
exit('Error: Photo type not supported!');
|
exit('Error: Photo type not supported!');
|
||||||
|
@ -40,6 +40,9 @@ class Session extends Module {
|
|||||||
# Return settings
|
# Return settings
|
||||||
$return['config'] = $this->settings;
|
$return['config'] = $this->settings;
|
||||||
|
|
||||||
|
# Path to Lychee for the server-import dialog
|
||||||
|
$return['config']['location'] = LYCHEE;
|
||||||
|
|
||||||
# Remove username and password from response
|
# Remove username and password from response
|
||||||
unset($return['config']['username']);
|
unset($return['config']['username']);
|
||||||
unset($return['config']['password']);
|
unset($return['config']['password']);
|
||||||
@ -47,9 +50,6 @@ class Session extends Module {
|
|||||||
# Remove identifier from response
|
# Remove identifier from response
|
||||||
unset($return['config']['identifier']);
|
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
|
# Check if login credentials exist and login if they don't
|
||||||
if ($this->noLogin()===true) {
|
if ($this->noLogin()===true) {
|
||||||
$public = false;
|
$public = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user