Browse Source

Merge pull request #8 from electerious/develop

Develop
Quentin Ligier 8 years ago
parent
commit
a27a4f96f0
3 changed files with 14 additions and 5 deletions
  1. 2 2
      docs/FAQ.md
  2. 10 1
      php/Modules/Database.php
  3. 2 2
      php/Modules/Photo.php

+ 2 - 2
docs/FAQ.md

@@ -2,10 +2,10 @@
 If Lychee is not working properly, try to open `plugins/Diagnostics/index.php`. This script will display all errors it can find.
 
 #### What do I need to run Lychee on my server?
-To run Lychee, everything you need is a web-server with PHP 5.3 or later and a MySQL-Database.
+To run Lychee, everything you need is a web-server with PHP 5.5 or later and a MySQL-Database.
 
 #### I can't upload photos
-If you experience problems uploading large photos, you might want to change the PHP parameters in `.htaccess` (if you are using the PHP Apache module) or in `.user.ini` (if you are using PHP >= 5.3 with CGI or FastCGI).
+If you experience problems uploading large photos, you might want to change the PHP parameters in `.htaccess` (if you are using the PHP Apache module) or in `.user.ini` (if you are using PHP >= 5.5 with CGI or FastCGI).
 
 If possible, change these settings directly in your `php.ini`. We recommend to increase the values of the following properties:
 

+ 10 - 1
php/Modules/Database.php

@@ -56,7 +56,7 @@ final class Database {
 		$connection = self::connect($host, $user, $password);
 
 		// Check if the connection was successful
-		if ($connection===false) Response::error($connection->connect_error);
+		if ($connection===false) Response::error(self::connect_error());
 
 		if (self::setCharset($connection)===false) Response::error('Could not set database charset!');
 
@@ -90,6 +90,15 @@ final class Database {
 
 	}
 
+	/**
+	 * @return string Returns the string description of the last connect error
+	 */
+	private static function connect_error() {
+
+		return mysqli_connect_error();
+
+	}
+
 	/**
 	 * @return boolean Returns true when successful.
 	 */

+ 2 - 2
php/Modules/Photo.php

@@ -741,7 +741,7 @@ final class Photo {
 		$return['focal']       = '';
 		$return['takestamp']   = 0;
 		$return['lens']        = '';
-		$return['tags']        = array();
+		$return['tags']        = '';
 		$return['position']    = '';
 		$return['latitude']    = '';
 		$return['longitude']   = '';
@@ -783,7 +783,7 @@ final class Photo {
 		}
 
 		// Read EXIF
-		if ($info['mime']=='image/jpeg') $exif = exif_read_data($url, 'EXIF', 0);
+		if ($info['mime']=='image/jpeg') $exif = @exif_read_data($url, 'EXIF', false, false);
 		else $exif = false;
 
 		// EXIF Metadata