aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/feedutils.php2
-rw-r--r--include/photo/photo_driver.php12
2 files changed, 12 insertions, 2 deletions
diff --git a/include/feedutils.php b/include/feedutils.php
index 158ecb7a3..cc873876a 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -691,7 +691,7 @@ function get_atom_elements($feed, $item, &$author) {
if(array_key_exists('verb',$res) && $res['verb'] === ACTIVITY_SHARE
- && array_key_exists('obj_type',$res) && $res['obj_type'] === ACTIVITY_OBJ_NOTE) {
+ && array_key_exists('obj_type',$res) && in_array($res['obj_type'], [ ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_COMMENT ] )) {
feed_get_reshare($res,$item);
}
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index eb61578e1..9d27ef96e 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -495,12 +495,22 @@ function guess_image_type($filename, $headers = '') {
}
}
- if(is_null($type)) {
+ if(is_null($type) && (strpos($filename,'http:') === false)) {
$size = getimagesize($filename);
$ph = photo_factory('');
$types = $ph->supportedTypes();
$type = ((array_key_exists($size['mime'], $types)) ? $size['mime'] : 'image/jpeg');
}
+ if(is_null($type)) {
+ if(strpos(strtolower($filename),'jpg') !== false)
+ $type = 'image/jpeg';
+ elseif(strpos(strtolower($filename),'jpeg') !== false)
+ $type = 'image/jpeg';
+ elseif(strpos(strtolower($filename),'gif') !== false)
+ $type = 'image/gif';
+ elseif(strpos(strtolower($filename),'png') !== false)
+ $type = 'image/png';
+ }
}
logger('Photo: guess_image_type: type = ' . $type, LOGGER_DEBUG);