aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/Photo.php2
-rwxr-xr-xinclude/diaspora.php8
-rwxr-xr-xinclude/items.php4
-rw-r--r--include/lock.php2
-rw-r--r--include/queue.php2
-rw-r--r--include/text.php10
-rw-r--r--mod/photos.php3
-rw-r--r--mod/profile.php2
-rw-r--r--mod/profile_photo.php8
-rw-r--r--mod/wall_upload.php7
10 files changed, 32 insertions, 16 deletions
diff --git a/include/Photo.php b/include/Photo.php
index 3af1691ee..ba4241a7b 100644
--- a/include/Photo.php
+++ b/include/Photo.php
@@ -143,7 +143,7 @@ class Photo {
public function orient($filename) {
// based off comment on http://php.net/manual/en/function.imagerotate.php
- if(! function_exists('exif_read_data'))
+ if( (! function_exists('exif_read_data')) || ($this->getType() !== 'image/jpeg') )
return;
$exif = exif_read_data($filename);
diff --git a/include/diaspora.php b/include/diaspora.php
index 7551ea9b3..2e7bf7522 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -1257,7 +1257,7 @@ function diaspora_comment($importer,$xml,$msg) {
if(($parent_item['origin']) && (! $parent_author_signature)) {
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($message_id),
- dbesc($author_signed_data),
+ dbesc($signed_data),
dbesc(base64_encode($author_signature)),
dbesc($diaspora_handle)
);
@@ -1840,7 +1840,7 @@ EOT;
if(! $parent_author_signature) {
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($message_id),
- dbesc($author_signed_data),
+ dbesc($signed_data),
dbesc(base64_encode($author_signature)),
dbesc($diaspora_handle)
);
@@ -2496,7 +2496,7 @@ function diaspora_send_mail($item,$owner,$contact) {
}
-function diaspora_transmit($owner,$contact,$slap,$public_batch) {
+function diaspora_transmit($owner,$contact,$slap,$public_batch,$queue_run = false) {
$enabled = intval(get_config('system','diaspora_enabled'));
if(! $enabled) {
@@ -2513,7 +2513,7 @@ function diaspora_transmit($owner,$contact,$slap,$public_batch) {
logger('diaspora_transmit: ' . $logid . ' ' . $dest_url);
- if(was_recently_delayed($contact['id'])) {
+ if( (! $queue_run) && (was_recently_delayed($contact['id']))) {
$return_code = 0;
}
else {
diff --git a/include/items.php b/include/items.php
index 5ae769244..1f90a1d05 100755
--- a/include/items.php
+++ b/include/items.php
@@ -3613,7 +3613,9 @@ function posted_dates($uid,$wall) {
$dnow = substr($dthen,0,8) . '28';
$ret = array();
- while($dnow >= $dthen) {
+ // Starting with the current month, get the first and last days of every
+ // month down to and including the month of the first post
+ while(substr($dnow, 0, 7) >= substr($dthen, 0, 7)) {
$dstart = substr($dnow,0,8) . '01';
$dend = substr($dnow,0,8) . get_dim(intval($dnow),intval(substr($dnow,5)));
$start_month = datetime_convert('','',$dstart,'Y-m-d');
diff --git a/include/lock.php b/include/lock.php
index 5f1ca6323..707e33609 100644
--- a/include/lock.php
+++ b/include/lock.php
@@ -73,5 +73,3 @@ function unlock_function($fn_name) {
return;
}}
-
-?>
diff --git a/include/queue.php b/include/queue.php
index 7e92705be..ba3babe70 100644
--- a/include/queue.php
+++ b/include/queue.php
@@ -161,7 +161,7 @@ function queue_run($argv, $argc){
case NETWORK_DIASPORA:
if($contact['notify']) {
logger('queue: diaspora_delivery: item ' . $q_item['id'] . ' for ' . $contact['name']);
- $deliver_status = diaspora_transmit($owner,$contact,$data,$public);
+ $deliver_status = diaspora_transmit($owner,$contact,$data,$public,true);
if($deliver_status == (-1))
update_queue_time($q_item['id']);
diff --git a/include/text.php b/include/text.php
index f3bc94265..59ef5a88f 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1328,10 +1328,14 @@ function file_tag_decode($s) {
function file_tag_file_query($table,$s,$type = 'file') {
if($type == 'file')
- $str = preg_quote( '[' . str_replace('%','%%',file_tag_encode($s)) . ']' );
+ $termtype = TERM_FILE;
else
- $str = preg_quote( '<' . str_replace('%','%%',file_tag_encode($s)) . '>' );
- return " AND " . (($table) ? dbesc($table) . '.' : '') . "file regexp '" . dbesc($str) . "' ";
+ $termtype = TERM_CATEGORY;
+
+ return sprintf(" AND " . (($table) ? dbesc($table) . '.' : '') . "id in (select term.oid from term where term.type = %d and term.term = '%s' and term.uid = " . (($table) ? dbesc($table) . '.' : '') . "uid ) ",
+ intval($termtype),
+ protect_sprintf(dbesc($s))
+ );
}
// ex. given music,video return <music><video> or [music][video]
diff --git a/mod/photos.php b/mod/photos.php
index 42cad42f9..624f0bdca 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -740,8 +740,7 @@ function photos_post(&$a) {
killme();
}
- if($ph->getType() != 'image/png')
- $ph->orient($src);
+ $ph->orient($src);
@unlink($src);
$max_length = get_config('system','max_image_length');
diff --git a/mod/profile.php b/mod/profile.php
index b53639c35..b48e035af 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -287,7 +287,7 @@ function profile_content(&$a, $update = 0) {
$tag_finder[] = $item['item_id'];
$tag_finder_str = implode(', ', $tag_finder);
$tags = q("select * from term where oid in ( '%s' ) and otype = %d",
- dbesc($tag_finder),
+ dbesc($tag_finder_str),
intval(TERM_OBJ_POST)
);
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index e44707f9b..fc0e0419e 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -127,7 +127,7 @@ function profile_photo_post(&$a) {
@unlink($src);
return;
}
-
+ $ph->orient($src);
@unlink($src);
return profile_photo_crop_ui_head($a, $ph);
@@ -237,6 +237,12 @@ function profile_photo_content(&$a) {
if(! function_exists('_crop_ui_head')) {
function profile_photo_crop_ui_head(&$a, $ph){
+ $max_length = get_config('system','max_image_length');
+ if(! $max_length)
+ $max_length = MAX_IMAGE_LENGTH;
+ if($max_length > 0)
+ $ph->scaleImage($max_length);
+
$width = $ph->getWidth();
$height = $ph->getHeight();
diff --git a/mod/wall_upload.php b/mod/wall_upload.php
index 5990f2834..07d97d17a 100644
--- a/mod/wall_upload.php
+++ b/mod/wall_upload.php
@@ -101,8 +101,15 @@ function wall_upload_post(&$a) {
killme();
}
+ $ph->orient($src);
@unlink($src);
+ $max_length = get_config('system','max_image_length');
+ if(! $max_length)
+ $max_length = MAX_IMAGE_LENGTH;
+ if($max_length > 0)
+ $ph->scaleImage($max_length);
+
$width = $ph->getWidth();
$height = $ph->getHeight();