upstream fixes and a lot of taxonomy stuff

This commit is contained in:
friendica 2012-07-10 06:28:02 -07:00
parent 1215de575d
commit 94fabe3a29
10 changed files with 32 additions and 16 deletions

View File

@ -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);

View File

@ -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 {

View File

@ -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');

View File

@ -73,5 +73,3 @@ function unlock_function($fn_name) {
return;
}}
?>

View File

@ -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']);

View File

@ -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]

View File

@ -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');

View File

@ -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)
);

View File

@ -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();

View File

@ -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();