upstream fixes and a lot of taxonomy stuff
This commit is contained in:
parent
1215de575d
commit
94fabe3a29
@ -143,7 +143,7 @@ class Photo {
|
|||||||
public function orient($filename) {
|
public function orient($filename) {
|
||||||
// based off comment on http://php.net/manual/en/function.imagerotate.php
|
// 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;
|
return;
|
||||||
|
|
||||||
$exif = exif_read_data($filename);
|
$exif = exif_read_data($filename);
|
||||||
|
@ -1257,7 +1257,7 @@ function diaspora_comment($importer,$xml,$msg) {
|
|||||||
if(($parent_item['origin']) && (! $parent_author_signature)) {
|
if(($parent_item['origin']) && (! $parent_author_signature)) {
|
||||||
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
|
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
|
||||||
intval($message_id),
|
intval($message_id),
|
||||||
dbesc($author_signed_data),
|
dbesc($signed_data),
|
||||||
dbesc(base64_encode($author_signature)),
|
dbesc(base64_encode($author_signature)),
|
||||||
dbesc($diaspora_handle)
|
dbesc($diaspora_handle)
|
||||||
);
|
);
|
||||||
@ -1840,7 +1840,7 @@ EOT;
|
|||||||
if(! $parent_author_signature) {
|
if(! $parent_author_signature) {
|
||||||
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
|
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
|
||||||
intval($message_id),
|
intval($message_id),
|
||||||
dbesc($author_signed_data),
|
dbesc($signed_data),
|
||||||
dbesc(base64_encode($author_signature)),
|
dbesc(base64_encode($author_signature)),
|
||||||
dbesc($diaspora_handle)
|
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'));
|
$enabled = intval(get_config('system','diaspora_enabled'));
|
||||||
if(! $enabled) {
|
if(! $enabled) {
|
||||||
@ -2513,7 +2513,7 @@ function diaspora_transmit($owner,$contact,$slap,$public_batch) {
|
|||||||
|
|
||||||
logger('diaspora_transmit: ' . $logid . ' ' . $dest_url);
|
logger('diaspora_transmit: ' . $logid . ' ' . $dest_url);
|
||||||
|
|
||||||
if(was_recently_delayed($contact['id'])) {
|
if( (! $queue_run) && (was_recently_delayed($contact['id']))) {
|
||||||
$return_code = 0;
|
$return_code = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -3613,7 +3613,9 @@ function posted_dates($uid,$wall) {
|
|||||||
$dnow = substr($dthen,0,8) . '28';
|
$dnow = substr($dthen,0,8) . '28';
|
||||||
|
|
||||||
$ret = array();
|
$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';
|
$dstart = substr($dnow,0,8) . '01';
|
||||||
$dend = substr($dnow,0,8) . get_dim(intval($dnow),intval(substr($dnow,5)));
|
$dend = substr($dnow,0,8) . get_dim(intval($dnow),intval(substr($dnow,5)));
|
||||||
$start_month = datetime_convert('','',$dstart,'Y-m-d');
|
$start_month = datetime_convert('','',$dstart,'Y-m-d');
|
||||||
|
@ -73,5 +73,3 @@ function unlock_function($fn_name) {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
?>
|
|
||||||
|
@ -161,7 +161,7 @@ function queue_run($argv, $argc){
|
|||||||
case NETWORK_DIASPORA:
|
case NETWORK_DIASPORA:
|
||||||
if($contact['notify']) {
|
if($contact['notify']) {
|
||||||
logger('queue: diaspora_delivery: item ' . $q_item['id'] . ' for ' . $contact['name']);
|
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))
|
if($deliver_status == (-1))
|
||||||
update_queue_time($q_item['id']);
|
update_queue_time($q_item['id']);
|
||||||
|
@ -1328,10 +1328,14 @@ function file_tag_decode($s) {
|
|||||||
function file_tag_file_query($table,$s,$type = 'file') {
|
function file_tag_file_query($table,$s,$type = 'file') {
|
||||||
|
|
||||||
if($type == 'file')
|
if($type == 'file')
|
||||||
$str = preg_quote( '[' . str_replace('%','%%',file_tag_encode($s)) . ']' );
|
$termtype = TERM_FILE;
|
||||||
else
|
else
|
||||||
$str = preg_quote( '<' . str_replace('%','%%',file_tag_encode($s)) . '>' );
|
$termtype = TERM_CATEGORY;
|
||||||
return " AND " . (($table) ? dbesc($table) . '.' : '') . "file regexp '" . dbesc($str) . "' ";
|
|
||||||
|
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]
|
// ex. given music,video return <music><video> or [music][video]
|
||||||
|
@ -740,8 +740,7 @@ function photos_post(&$a) {
|
|||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($ph->getType() != 'image/png')
|
$ph->orient($src);
|
||||||
$ph->orient($src);
|
|
||||||
@unlink($src);
|
@unlink($src);
|
||||||
|
|
||||||
$max_length = get_config('system','max_image_length');
|
$max_length = get_config('system','max_image_length');
|
||||||
|
@ -287,7 +287,7 @@ function profile_content(&$a, $update = 0) {
|
|||||||
$tag_finder[] = $item['item_id'];
|
$tag_finder[] = $item['item_id'];
|
||||||
$tag_finder_str = implode(', ', $tag_finder);
|
$tag_finder_str = implode(', ', $tag_finder);
|
||||||
$tags = q("select * from term where oid in ( '%s' ) and otype = %d",
|
$tags = q("select * from term where oid in ( '%s' ) and otype = %d",
|
||||||
dbesc($tag_finder),
|
dbesc($tag_finder_str),
|
||||||
intval(TERM_OBJ_POST)
|
intval(TERM_OBJ_POST)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ function profile_photo_post(&$a) {
|
|||||||
@unlink($src);
|
@unlink($src);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$ph->orient($src);
|
||||||
@unlink($src);
|
@unlink($src);
|
||||||
return profile_photo_crop_ui_head($a, $ph);
|
return profile_photo_crop_ui_head($a, $ph);
|
||||||
|
|
||||||
@ -237,6 +237,12 @@ function profile_photo_content(&$a) {
|
|||||||
|
|
||||||
if(! function_exists('_crop_ui_head')) {
|
if(! function_exists('_crop_ui_head')) {
|
||||||
function profile_photo_crop_ui_head(&$a, $ph){
|
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();
|
$width = $ph->getWidth();
|
||||||
$height = $ph->getHeight();
|
$height = $ph->getHeight();
|
||||||
|
|
||||||
|
@ -101,8 +101,15 @@ function wall_upload_post(&$a) {
|
|||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$ph->orient($src);
|
||||||
@unlink($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();
|
$width = $ph->getWidth();
|
||||||
$height = $ph->getHeight();
|
$height = $ph->getHeight();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user