aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-05-05 22:49:46 -0700
committerfriendica <info@friendica.com>2013-05-05 22:49:46 -0700
commit524f205caa1fc95371acaed95c4af12ec4dd7745 (patch)
tree0255a161ed3182bb23e65a3db3adaa25cbe036cd
parent175f30d7cc287412bc2555bc17c158a3af231dad (diff)
downloadvolse-hubzilla-524f205caa1fc95371acaed95c4af12ec4dd7745.tar.gz
volse-hubzilla-524f205caa1fc95371acaed95c4af12ec4dd7745.tar.bz2
volse-hubzilla-524f205caa1fc95371acaed95c4af12ec4dd7745.zip
photo driver issue when updating contact photos - old class structure used instead of photo_factory()
-rw-r--r--boot.php2
-rw-r--r--include/account.php2
-rw-r--r--include/photo/photo_driver.php8
3 files changed, 7 insertions, 5 deletions
diff --git a/boot.php b/boot.php
index 401fd458e..6fd785621 100644
--- a/boot.php
+++ b/boot.php
@@ -1099,7 +1099,7 @@ function check_config(&$a) {
. 'Content-type: text/plain; charset=UTF-8' . "\n"
. 'Content-transfer-encoding: 8bit' );
//try the logger
- logger('CRITICAL: Update Failed: '. $x);
+ logger('CRITICAL: Update Failed: ' . $x);
}
else
set_config('database','update_r' . $x, 'success');
diff --git a/include/account.php b/include/account.php
index 72d44d9ca..1572583c7 100644
--- a/include/account.php
+++ b/include/account.php
@@ -26,7 +26,7 @@ function check_account_email($email) {
$r = q("select account_email from account where account_email = '%s' limit 1",
dbesc($email)
);
- if(count($r)) {
+ if($r) {
$result['message'] .= t('Your email address is already registered at this site.');
}
}
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index 27237c530..25f53f400 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -378,6 +378,7 @@ function guess_image_type($filename, $fromcurl=false) {
$type = $headers['Content-Type'];
}
if (is_null($type)){
+// FIXME!!!!
// Guessing from extension? Isn't that... dangerous?
if(class_exists('Imagick') && file_exists($filename) && is_readable($filename)) {
/**
@@ -389,7 +390,8 @@ function guess_image_type($filename, $fromcurl=false) {
$type = $image->getImageMimeType();
} else {
$ext = pathinfo($filename, PATHINFO_EXTENSION);
- $types = Photo::supportedTypes();
+ $ph = photo_factory('');
+ $types = $ph->supportedTypes();
$type = "image/jpeg";
foreach ($types as $m=>$e){
if ($ext==$e) $type = $m;
@@ -427,7 +429,7 @@ function import_profile_photo($photo,$xchan) {
if($result['success'])
$img_str = $result['body'];
- $img = new Photo($img_str, $type);
+ $img = photo_factory($img_str, $type);
if($img->is_valid()) {
$img->scaleImageSquare(175);
@@ -485,7 +487,7 @@ function import_channel_photo($photo,$type,$aid,$uid) {
$filename = $hash;
- $img = new Photo($photo, $type);
+ $img = photo_factory($photo, $type);
if($img->is_valid()) {
$img->scaleImageSquare(175);