From 96857389ac6a9ab11f0543da5b0af3895dfccfaf Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 23 Jun 2011 01:57:14 -0700 Subject: friendika-z initial implementation --- mod/item.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index 84fe237b3..9d7b954a8 100644 --- a/mod/item.php +++ b/mod/item.php @@ -445,6 +445,7 @@ function item_post(&$a) { $datarray['parent'] = $parent; $datarray['self'] = $self; + $datarray['prvnets'] = $user['prvnets']; if($orig_post) $datarray['edit'] = true; -- cgit v1.2.3 From 5633430a19624423ddd98655518d8a765f081230 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 23 Jun 2011 15:58:43 -0700 Subject: don't allow tags in app source --- mod/item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index 9d7b954a8..22eba7b3f 100644 --- a/mod/item.php +++ b/mod/item.php @@ -61,7 +61,7 @@ function item_post(&$a) { $profile_uid = ((x($_POST,'profile_uid')) ? intval($_POST['profile_uid']) : 0); $post_id = ((x($_POST['post_id'])) ? intval($_POST['post_id']) : 0); - $app = ((x($_POST['source'])) ? notags($_POST['source']) : ''); + $app = ((x($_POST['source'])) ? strip_tags($_POST['source']) : ''); if(! can_write_wall($a,$profile_uid)) { notice( t('Permission denied.') . EOL) ; -- cgit v1.2.3 From 38cf37d3c3a4bc9873aa12eed5167b356282385f Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 23 Jun 2011 17:56:59 -0700 Subject: new item view, sort by received date - not posted date. --- mod/item.php | 6 ++++-- mod/network.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index 22eba7b3f..f87b6074a 100644 --- a/mod/item.php +++ b/mod/item.php @@ -419,6 +419,7 @@ function item_post(&$a) { $datarray['author-avatar'] = $author['thumb']; $datarray['created'] = datetime_convert(); $datarray['edited'] = datetime_convert(); + $datarray['received'] = datetime_convert(); $datarray['changed'] = datetime_convert(); $datarray['uri'] = $uri; $datarray['title'] = $title; @@ -473,9 +474,9 @@ function item_post(&$a) { $r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`, - `author-name`, `author-link`, `author-avatar`, `created`, `edited`, `changed`, `uri`, `title`, `body`, `app`, `location`, `coord`, + `author-name`, `author-link`, `author-avatar`, `created`, `edited`, `received`, `changed`, `uri`, `title`, `body`, `app`, `location`, `coord`, `tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private`, `pubmail`, `attach` ) - VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s' )", + VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s' )", intval($datarray['uid']), dbesc($datarray['type']), intval($datarray['wall']), @@ -489,6 +490,7 @@ function item_post(&$a) { dbesc($datarray['author-avatar']), dbesc($datarray['created']), dbesc($datarray['edited']), + dbesc($datarray['received']), dbesc($datarray['changed']), dbesc($datarray['uri']), dbesc($datarray['title']), diff --git a/mod/network.php b/mod/network.php index 75775ba50..9c5202ad2 100644 --- a/mod/network.php +++ b/mod/network.php @@ -212,7 +212,7 @@ function network_content(&$a, $update = 0) { AND `contact`.`id` = `item`.`contact-id` AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 $sql_extra - ORDER BY `item`.`created` DESC LIMIT %d ,%d ", + ORDER BY `item`.`received` DESC LIMIT %d ,%d ", intval($_SESSION['uid']), intval($a->pager['start']), intval($a->pager['itemspage']) -- cgit v1.2.3 From a15bd91d1733e8198169a1a492f0268691b7152a Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 23 Jun 2011 18:25:33 -0700 Subject: don't update an event that hasn't changed. --- mod/dfrn_notify.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod') diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index f6d1f2be5..dd0172243 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -676,6 +676,7 @@ function dfrn_notify_post(&$a) { $ev['cid'] = $importer['id']; $ev['uid'] = $importer['uid']; $ev['uri'] = $item_id; + $ev['edited'] = $datarray['edited']; $r = q("SELECT * FROM `event` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($item_id), -- cgit v1.2.3 From e320975d7313b4dc8ed1a21c2c94778c4d6b69f9 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 23 Jun 2011 22:23:26 -0700 Subject: bug #95 --- mod/dfrn_confirm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 7c11b78d5..e2094b1f3 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -507,7 +507,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { $local_uid = $r[0]['uid']; - if(! strstr($my_prvkey,'BEGIN RSA PRIVATE KEY')) { + if(! strstr($my_prvkey,'PRIVATE KEY')) { $message = t('Our site encryption key is apparently messed up.'); xml_status(3,$message); } -- cgit v1.2.3 From 59d9070d13949d596d24524acaef9d35e8feba8c Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 25 Jun 2011 19:10:38 -0700 Subject: suggestion template --- mod/dfrn_notify.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index dd0172243..6cb4f69a0 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -171,7 +171,7 @@ function dfrn_notify_post(&$a) { $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `url` = '%s' AND `uid` = %d LIMIT 1", dbesc($fsugg['name']), - dbesc($fsuff['url']), + dbesc($fsugg['url']), intval($fsugg['uid']) ); if(count($r)) @@ -182,7 +182,7 @@ function dfrn_notify_post(&$a) { $fid = 0; $r = q("SELECT * FROM `fcontact` WHERE `url` = '%s' AND `name` = '%s' AND `photo` = '%s' LIMIT 1", dbesc($fsugg['url']), - dbesc($fsuff['name']), + dbesc($fsugg['name']), dbesc($fsugg['photo']) ); if(count($r)) { @@ -190,13 +190,13 @@ function dfrn_notify_post(&$a) { } if(! $fid) $r = q("INSERT INTO `fcontact` ( `name`,`url`,`photo` ) VALUES ( '%s', '%s', '%s' ) ", - dbesc($fsuff['name']), + dbesc($fsugg['name']), dbesc($fsugg['url']), dbesc($fsugg['photo']) ); $r = q("SELECT * FROM `fcontact` WHERE `url` = '%s' AND `name` = '%s' AND `photo` = '%s' LIMIT 1", dbesc($fsugg['url']), - dbesc($fsuff['name']), + dbesc($fsugg['name']), dbesc($fsugg['photo']) ); if(count($r)) { -- cgit v1.2.3 From c9604ef57839e16839e69aa23a21ed8921409343 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 25 Jun 2011 19:40:37 -0700 Subject: allow cross-site xrd/lrdd/webfinger --- mod/xrd.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/xrd.php b/mod/xrd.php index 8ac6ff7cf..de0c20ea5 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -24,7 +24,7 @@ function xrd_content(&$a) { $salmon_key = salmon_key($r[0]['spubkey']); - + header('Access-Control-Allow-Origin: *'); header("Content-type: text/xml"); $tpl = file_get_contents('view/xrd_person.tpl'); -- cgit v1.2.3 From 3fe1e197254f62e5377c28a24e4d5a75014e931b Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 26 Jun 2011 19:30:57 -0700 Subject: pass notify endpoint with friend suggestions --- mod/dfrn_notify.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'mod') diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 6cb4f69a0..31314da7b 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -165,6 +165,7 @@ function dfrn_notify_post(&$a) { $fsugg['name'] = notags(unxmlify($base['name'][0]['data'])); $fsugg['photo'] = notags(unxmlify($base['photo'][0]['data'])); $fsugg['url'] = notags(unxmlify($base['url'][0]['data'])); + $fsugg['request'] = notags(unxmlify($base['request'][0]['data'])); $fsugg['body'] = escape_tags(unxmlify($base['note'][0]['data'])); // Does our member already have a friend matching this description? @@ -180,24 +181,25 @@ function dfrn_notify_post(&$a) { // Do we already have an fcontact record for this person? $fid = 0; - $r = q("SELECT * FROM `fcontact` WHERE `url` = '%s' AND `name` = '%s' AND `photo` = '%s' LIMIT 1", + $r = q("SELECT * FROM `fcontact` WHERE `url` = '%s' AND `name` = '%s' AND `request` = '%s' LIMIT 1", dbesc($fsugg['url']), dbesc($fsugg['name']), - dbesc($fsugg['photo']) + dbesc($fsugg['request']) ); if(count($r)) { $fid = $r[0]['id']; } if(! $fid) - $r = q("INSERT INTO `fcontact` ( `name`,`url`,`photo` ) VALUES ( '%s', '%s', '%s' ) ", + $r = q("INSERT INTO `fcontact` ( `name`,`url`,`photo`,`request` ) VALUES ( '%s', '%s', '%s', '%s' ) ", dbesc($fsugg['name']), dbesc($fsugg['url']), - dbesc($fsugg['photo']) + dbesc($fsugg['photo']), + dbesc($fsugg['request']) ); - $r = q("SELECT * FROM `fcontact` WHERE `url` = '%s' AND `name` = '%s' AND `photo` = '%s' LIMIT 1", + $r = q("SELECT * FROM `fcontact` WHERE `url` = '%s' AND `name` = '%s' AND `request` = '%s' LIMIT 1", dbesc($fsugg['url']), dbesc($fsugg['name']), - dbesc($fsugg['photo']) + dbesc($fsugg['request']) ); if(count($r)) { $fid = $r[0]['id']; -- cgit v1.2.3 From 23f00aaab42a39905c74d06a3864719214122a1f Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 26 Jun 2011 21:55:24 -0700 Subject: recipient ui, friend suggestions --- mod/notifications.php | 55 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 12 deletions(-) (limited to 'mod') diff --git a/mod/notifications.php b/mod/notifications.php index a3339199e..90f62fa47 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -13,11 +13,9 @@ function notifications_post(&$a) { if($request_id) { - $r = q("SELECT * FROM `intro` - WHERE `id` = %d - AND `uid` = %d LIMIT 1", - intval($request_id), - intval(local_user()) + $r = q("SELECT * FROM `intro` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($request_id), + intval(local_user()) ); if(count($r)) { @@ -28,14 +26,22 @@ function notifications_post(&$a) { notice( t('Invalid request identifier.') . EOL); return; } + + // If it is a friend suggestion, the contact is not a new friend but an existing friend + // that should not be deleted. + + $fid = $r[0]['fid']; + if($_POST['submit'] == t('Discard')) { $r = q("DELETE FROM `intro` WHERE `id` = %d LIMIT 1", intval($intro_id) ); - $r = q("DELETE FROM `contact` WHERE `id` = %d AND `uid` = %d AND `self` = 0 LIMIT 1", - intval($contact_id), - intval(local_user()) - ); + if(! $fid) { + $r = q("DELETE FROM `contact` WHERE `id` = %d AND `uid` = %d AND `self` = 0 LIMIT 1", + intval($contact_id), + intval(local_user()) + ); + } return; } if($_POST['submit'] == t('Ignore')) { @@ -81,18 +87,41 @@ function notifications_content(&$a) { $a->set_pager_itemspage(20); } - $r = q("SELECT `intro`.`id` AS `intro_id`, `intro`.*, `contact`.* - FROM `intro` LEFT JOIN `contact` ON `intro`.`contact-id` = `contact`.`id` + $r = q("SELECT `intro`.`id` AS `intro_id`, `intro`.*, `contact`.*, `fcontact`.`name` AS `fname`,`fcontact`.`url` AS `furl`,`fcontact`.`photo` AS `fphoto`,`fcontact`.`request` AS `frequest` + FROM `intro` LEFT JOIN `contact` ON `contact`.`id` = `intro`.`contact-id` LEFT JOIN `fcontact` ON `intro`.`fid` = `fcontact`.`id` WHERE `intro`.`uid` = %d $sql_extra AND `intro`.`blocked` = 0 ", intval($_SESSION['uid'])); if(($r !== false) && (count($r))) { - + $sugg = get_markup_template('suggestions.tpl'); $tpl = get_markup_template("intros.tpl"); foreach($r as $rr) { + if($rr['fid']) { + $return_addr = bin2hex($a->user['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : '')); + $o .= replace_macros($sugg,array( + '$str_notifytype' => t('Notification type: '), + '$notify_type' => t('Friend Suggestion'), + '$intro_id' => $rr['intro_id'], + '$madeby' => sprintf( t('suggested by %s'),$rr['name']), + '$contact_id' => $rr['contact-id'], + '$photo' => ((x($rr,'fphoto')) ? $rr['fphoto'] : "images/default-profile.jpg"), + '$fullname' => $rr['fname'], + '$url' => $rr['furl'], + '$knowyou' => $knowyou, + '$approve' => t('Approve'), + '$note' => $rr['note'], + '$request' => $rr['frequest'] . '?addr=' . $return_addr, + '$ignore' => t('Ignore'), + '$discard' => t('Discard') + + )); + + continue; + + } $friend_selected = (($rr['network'] !== 'stat') ? ' checked="checked" ' : ' disabled '); $fan_selected = (($rr['network'] === 'stat') ? ' checked="checked" disabled ' : ''); $dfrn_tpl = get_markup_template('netfriend.tpl'); @@ -138,6 +167,7 @@ function notifications_content(&$a) { else info( t('No notifications.') . EOL); +/* if ($a->config['register_policy'] == REGISTER_APPROVE && $a->config['admin_email'] === $a->user['email']){ $o .= '

' . t('User registrations waiting for confirm') . '

' . "\r\n"; @@ -159,6 +189,7 @@ function notifications_content(&$a) { info( t('No registrations.') . EOL); } +*/ $o .= paginate($a); return $o; -- cgit v1.2.3 From c410c9013c062a9a4fce1f887572a1b1c951afbe Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 26 Jun 2011 22:57:08 -0700 Subject: friend suggestions --- mod/contacts.php | 5 +++ mod/fsuggest.php | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 mod/fsuggest.php (limited to 'mod') diff --git a/mod/contacts.php b/mod/contacts.php index e7a800500..444e6dec4 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -268,6 +268,10 @@ function contacts_content(&$a) { if($r[0]['last-update'] !== '0000-00-00 00:00:00') $last_update .= ' ' . (($r[0]['last-update'] == $r[0]['success_update']) ? t("\x28Update was successful\x29") : t("\x28Update was not successful\x29")); + $lblsuggest = (($r[0]['network'] === NETWORK_DFRN) + ? '' : ''); + + $o .= replace_macros($tpl,array( '$header' => t('Contact Editor'), '$submit' => t('Submit'), @@ -284,6 +288,7 @@ function contacts_content(&$a) { '$altcrepair' => t('Repair contact URL settings'), '$lblcrepair' => t("Repair contact URL settings \x28WARNING: Advanced\x29"), '$lblrecent' => t('View conversations'), + '$lblsuggest' => $lblsuggest, '$grps' => $grps, '$delete' => t('Delete contact'), '$poll_interval' => contact_poll_interval($r[0]['priority']), diff --git a/mod/fsuggest.php b/mod/fsuggest.php new file mode 100644 index 000000000..29fb79cfb --- /dev/null +++ b/mod/fsuggest.php @@ -0,0 +1,114 @@ +argc != 2) + return; + + $contact_id = intval($a->argv[1]); + + $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($contact_id), + intval(local_user()) + ); + if(! count($r)) { + notice( t('Contact not found.') . EOL); + return; + } + $contact = $r[0]; + + $new_contact = intval($_POST['suggest']); + + $hash = random_string(); + + $note = escape_tags(trim($_POST['note'])); + + if($new_contact) { + $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($new_contact), + intval(local_user()) + ); + if(count($r)) { + + $x = q("INSERT INTO `fsuggest` ( `uid`,`cid`,`name`,`url`,`request`,`photo`,`note`,`created`) + VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')", + intval(local_user()), + intval($contact_id), + dbesc($r[0]['name']), + dbesc($r[0]['url']), + dbesc($r[0]['request']), + dbesc($r[0]['photo']), + dbesc($hash), + dbesc(datetime_convert()) + ); + $r = q("SELECT `id` FROM `fsuggest` WHERE `note` = '%s' AND `uid` = %d LIMIT 1", + dbesc($hash), + intval(local_user()) + ); + if(count($r)) { + $fsuggest_id = $r[0]['id']; + q("UPDATE `fsuggest` SET `note` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1", + dbesc($note), + intval($fsuggest_id), + intval(local_user()) + ); + proc_run('php', 'include/notifier.php', 'suggest' , $fsuggest_id); + } + + info( t('Friend suggestion sent.') . EOL); + } + + } + + +} + + + +function fsuggest_content(&$a) { + + require_once('include/acl_selectors.php'); + + if(! local_user()) { + notice( t('Permission denied.') . EOL); + return; + } + + if($a->argc != 2) + return; + + $contact_id = intval($a->argv[1]); + + $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($contact_id), + intval(local_user()) + ); + if(! count($r)) { + notice( t('Contact not found.') . EOL); + return; + } + $contact = $r[0]; + + + + + $o = '

' . t('Suggest Friends') . '

'; + + $o .= sprintf( t('Suggest a friend for %s'), $contact['name']); + + $o .= '
'; + + // TODO: selector should have an option to ignore the recipient + $o .= contact_select('suggest','suggest-select', $preselect, 4, true); + + + $o .= ''; + $o .= '
'; + + return $o; +} \ No newline at end of file -- cgit v1.2.3 From 06a4c0f703d64cae1e72c2901742e3c101623a7b Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 27 Jun 2011 03:03:58 -0700 Subject: ignore current contact on friend suggestion picker --- mod/fsuggest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/fsuggest.php b/mod/fsuggest.php index 29fb79cfb..dc95fb8e1 100644 --- a/mod/fsuggest.php +++ b/mod/fsuggest.php @@ -103,8 +103,8 @@ function fsuggest_content(&$a) { $o .= '
'; - // TODO: selector should have an option to ignore the recipient - $o .= contact_select('suggest','suggest-select', $preselect, 4, true); + $o .= contact_selector('suggest','suggest-select', false, + array('size' => 4, 'exclude' => $contact_id, 'networks' => 'DFRN_ONLY', 'single' => true)); $o .= ''; -- cgit v1.2.3 From 14c002d7a4b96c8b1cbabec30614af4fe7b22d5a Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 27 Jun 2011 03:09:45 -0700 Subject: make friend suggest themeable --- mod/fsuggest.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mod') diff --git a/mod/fsuggest.php b/mod/fsuggest.php index dc95fb8e1..5044be72d 100644 --- a/mod/fsuggest.php +++ b/mod/fsuggest.php @@ -94,20 +94,17 @@ function fsuggest_content(&$a) { } $contact = $r[0]; - - - $o = '

' . t('Suggest Friends') . '

'; - $o .= sprintf( t('Suggest a friend for %s'), $contact['name']); + $o .= '
' . sprintf( t('Suggest a friend for %s'), $contact['name']) . '
'; - $o .= ''; + $o .= ''; $o .= contact_selector('suggest','suggest-select', false, array('size' => 4, 'exclude' => $contact_id, 'networks' => 'DFRN_ONLY', 'single' => true)); - $o .= ''; + $o .= ''; $o .= ''; return $o; -- cgit v1.2.3 From 1947b74e5bd92f11a3e8af2223826e649233a883 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 27 Jun 2011 16:18:06 -0700 Subject: some basic margins for friend suggestion screen --- mod/fsuggest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/fsuggest.php b/mod/fsuggest.php index 5044be72d..9ef8f4c55 100644 --- a/mod/fsuggest.php +++ b/mod/fsuggest.php @@ -104,7 +104,7 @@ function fsuggest_content(&$a) { array('size' => 4, 'exclude' => $contact_id, 'networks' => 'DFRN_ONLY', 'single' => true)); - $o .= ''; + $o .= '
'; $o .= ''; return $o; -- cgit v1.2.3 From 4418cb4349341064690cfbe6d4f26542cf108203 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 27 Jun 2011 18:13:44 -0700 Subject: preformat webfinger output --- mod/webfinger.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod') diff --git a/mod/webfinger.php b/mod/webfinger.php index dd6d72a13..5ef29e43f 100644 --- a/mod/webfinger.php +++ b/mod/webfinger.php @@ -18,7 +18,9 @@ function webfinger_content(&$a) { $res = webfinger($addr); else $res = lrdd($addr); + $o .= '
';
 		$o .= str_replace("\n",'
',print_r($res,true)); + $o .= '
'; } return $o; } \ No newline at end of file -- cgit v1.2.3 From 932397b47be25b042907ab888e3abcb51cbb84b2 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 27 Jun 2011 19:47:55 -0700 Subject: trim webfinger request --- mod/webfinger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/webfinger.php b/mod/webfinger.php index 5ef29e43f..f6d6026b4 100644 --- a/mod/webfinger.php +++ b/mod/webfinger.php @@ -13,7 +13,7 @@ function webfinger_content(&$a) { $o .= '

'; if(x($_GET,'addr')) { - $addr = $_GET['addr']; + $addr = trim($_GET['addr']); if(strpos($addr,'@' !== false)) $res = webfinger($addr); else -- cgit v1.2.3 From 4ca6a9a38257a8f8c82842ce734ae946b90ebb4c Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 28 Jun 2011 18:59:41 -0700 Subject: dbg info for photo uploads --- mod/photos.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mod') diff --git a/mod/photos.php b/mod/photos.php index bbdb8b7e9..28ed609b5 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -590,6 +590,9 @@ function photos_post(&$a) { $filesize = intval($_FILES['userfile']['size']); } + + logger('photos: upload: received file: ' . $filename . ' as ' . $src . ' ' . $filesize . ' bytes', LOGGER_DEBUG); + $maximagesize = get_config('system','maximagesize'); if(($maximagesize) && ($filesize > $maximagesize)) { @@ -600,6 +603,14 @@ function photos_post(&$a) { return; } + if(! $filesize) { + notice( t('Image file is empty.') . EOL); + @unlink($src); + $foo = 0; + call_hooks('photo_post_end',$foo); + return; + } + logger('mod/photos.php: photos_post(): loading the contents of ' . $src , 'LOGGER_DEBUG'); $imagedata = @file_get_contents($src); -- cgit v1.2.3 From 0b221e8945ae785dc706d8ea9a9e8e25532c0096 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 28 Jun 2011 21:11:52 -0700 Subject: bug #96 move libraries to library - better alignment of like rotator --- mod/dfrn_notify.php | 2 +- mod/salmon.php | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'mod') diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 31314da7b..64b5ec479 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -1,6 +1,6 @@ Date: Tue, 28 Jun 2011 22:33:02 -0700 Subject: do not translate hidden photo album 'Contact Photos' as it may become unhidden when different language is used. --- mod/photos.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'mod') diff --git a/mod/photos.php b/mod/photos.php index 28ed609b5..2cd4e2622 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -35,7 +35,11 @@ function photos_init(&$a) { $o .= '