Merge remote-tracking branch 'friendica/master' into mail_notification_cleanup
This commit is contained in:
commit
21b1e09fad
131 changed files with 80051 additions and 81253 deletions
|
@ -1203,9 +1203,11 @@ function admin_page_themes(&$a){
|
|||
foreach($files as $file) {
|
||||
$f = basename($file);
|
||||
$is_experimental = intval(file_exists($file . '/experimental'));
|
||||
$is_supported = 1-(intval(file_exists($file . '/unsupported'))); // Is not used yet
|
||||
$is_supported = 1-(intval(file_exists($file . '/unsupported')));
|
||||
$is_allowed = intval(in_array($f,$allowed_themes));
|
||||
$themes[] = array('name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed);
|
||||
|
||||
if ($is_allowed OR $is_supported OR get_config("system", "show_unsupported_themes"))
|
||||
$themes[] = array('name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -145,6 +145,14 @@ function crepair_content(&$a) {
|
|||
|
||||
$o .= EOL . '<a href="contacts/' . $cid . '">' . t('Return to contact editor') . '</a>' . EOL;
|
||||
|
||||
$allow_remote_self = get_config('system','allow_users_remote_self');
|
||||
|
||||
// Disable remote self for everything except feeds.
|
||||
// There is an issue when you repeat an item from maybe twitter and you got comments from friendica and twitter
|
||||
// Problem is, you couldn't reply to both networks.
|
||||
if ($contact['network'] != NETWORK_FEED)
|
||||
$allow_remote_self = false;
|
||||
|
||||
$tpl = get_markup_template('crepair.tpl');
|
||||
$o .= replace_macros($tpl, array(
|
||||
'$label_name' => t('Name'),
|
||||
|
@ -157,7 +165,7 @@ function crepair_content(&$a) {
|
|||
'$label_poll' => t('Poll/Feed URL'),
|
||||
'$label_photo' => t('New photo from this URL'),
|
||||
'$label_remote_self' => t('Remote Self'),
|
||||
'$allow_remote_self' => get_config('system','allow_users_remote_self'),
|
||||
'$allow_remote_self' => $allow_remote_self,
|
||||
'$remote_self' => array('remote_self', t('Mirror postings from this contact'), $contact['remote_self'], t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'), array('0'=>t('No mirroring'), '1'=>t('Mirror as forwarded posting'), '2'=>t('Mirror as my own posting'))),
|
||||
'$contact_name' => $contact['name'],
|
||||
'$contact_nick' => $contact['nick'],
|
||||
|
|
|
@ -106,7 +106,7 @@ function editpost_content(&$a) {
|
|||
$o .= replace_macros($tpl,array(
|
||||
'$return_path' => $_SESSION['return_url'],
|
||||
'$action' => 'item',
|
||||
'$share' => t('Edit'),
|
||||
'$share' => t('Save'),
|
||||
'$upload' => t('Upload photo'),
|
||||
'$shortupload' => t('upload photo'),
|
||||
'$attach' => t('Attach file'),
|
||||
|
|
|
@ -52,6 +52,8 @@ function completeurl($url, $scheme) {
|
|||
|
||||
function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $count = 1) {
|
||||
|
||||
$a = get_app();
|
||||
|
||||
$siteinfo = array();
|
||||
|
||||
if ($count > 10) {
|
||||
|
@ -71,7 +73,7 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co
|
|||
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt($ch,CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; ".FRIENDICA_PLATFORM." ".FRIENDICA_VERSION."-".DB_UPDATE_VERSION.")");
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
|
||||
|
||||
$header = curl_exec($ch);
|
||||
$curl_info = @curl_getinfo($ch);
|
||||
|
|
|
@ -120,16 +120,16 @@ function photo_init(&$a) {
|
|||
$public = ($r[0]['allow_cid'] == '') AND ($r[0]['allow_gid'] == '') AND ($r[0]['deny_cid'] == '') AND ($r[0]['deny_gid'] == '');
|
||||
|
||||
if(count($r)) {
|
||||
$resolution = $r[0]['scale'];
|
||||
$resolution = $r[0]['scale'];
|
||||
$data = $r[0]['data'];
|
||||
$mimetype = $r[0]['type'];
|
||||
}
|
||||
else {
|
||||
// The picure exists. We already checked with the first query.
|
||||
// obviously, this is not an authorized viev!
|
||||
$data = file_get_contents('images/nosign.jpg');
|
||||
$mimetype = 'image/jpeg';
|
||||
$prvcachecontrol = true;
|
||||
} else {
|
||||
// The picure exists. We already checked with the first query.
|
||||
// obviously, this is not an authorized viev!
|
||||
$data = file_get_contents('images/nosign.jpg');
|
||||
$mimetype = 'image/jpeg';
|
||||
$prvcachecontrol = true;
|
||||
$public = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ function update_community_content(&$a) {
|
|||
|
||||
header("Content-type: text/html");
|
||||
echo "<!DOCTYPE html><html><body>\r\n";
|
||||
echo (($_GET['msie'] == 1) ? '<div>' : '<section>');
|
||||
echo "<section>";
|
||||
|
||||
$text = community_content($a,true);
|
||||
$pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
|
||||
|
@ -26,7 +26,7 @@ function update_community_content(&$a) {
|
|||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
||||
echo str_replace("\t",' ',$text);
|
||||
echo (($_GET['msie'] == 1) ? '</div>' : '</section>');
|
||||
echo "</section>";
|
||||
echo "</body></html>\r\n";
|
||||
killme();
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ function update_display_content(&$a) {
|
|||
|
||||
header("Content-type: text/html");
|
||||
echo "<!DOCTYPE html><html><body>\r\n";
|
||||
echo (($_GET['msie'] == 1) ? '<div>' : '<section>');
|
||||
echo "<section>";
|
||||
|
||||
|
||||
$text = display_content($a,$profile_uid);
|
||||
|
@ -31,7 +31,7 @@ function update_display_content(&$a) {
|
|||
|
||||
|
||||
echo str_replace("\t",' ',$text);
|
||||
echo (($_GET['msie'] == 1) ? '</div>' : '</section>');
|
||||
echo "</section>";
|
||||
echo "</body></html>\r\n";
|
||||
killme();
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ function update_network_content(&$a) {
|
|||
|
||||
header("Content-type: text/html");
|
||||
echo "<!DOCTYPE html><html><body>\r\n";
|
||||
echo (($_GET['msie'] == 1) ? '<div>' : '<section>');
|
||||
echo "<section>";
|
||||
|
||||
if (!get_pconfig($profile_uid, "system", "no_auto_update") OR ($_GET['force'] == 1))
|
||||
$text = network_content($a,$profile_uid);
|
||||
|
@ -34,7 +34,7 @@ function update_network_content(&$a) {
|
|||
|
||||
|
||||
echo str_replace("\t",' ',$text);
|
||||
echo (($_GET['msie'] == 1) ? '</div>' : '</section>');
|
||||
echo "</section>";
|
||||
echo "</body></html>\r\n";
|
||||
killme();
|
||||
|
||||
|
|
|
@ -16,11 +16,7 @@ function update_notes_content(&$a) {
|
|||
header("Content-type: text/html");
|
||||
echo "<!DOCTYPE html><html><body>\r\n";
|
||||
|
||||
/**
|
||||
* We can remove this hack once Internet Explorer recognises HTML5 natively
|
||||
*/
|
||||
|
||||
echo (($_GET['msie'] == 1) ? '<div>' : '<section>');
|
||||
echo "<section>";
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -53,7 +49,7 @@ function update_notes_content(&$a) {
|
|||
*/
|
||||
|
||||
echo str_replace("\t",' ',$text);
|
||||
echo (($_GET['msie'] == 1) ? '</div>' : '</section>');
|
||||
echo "</section>";
|
||||
echo "</body></html>\r\n";
|
||||
killme();
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ function update_profile_content(&$a) {
|
|||
* We can remove this hack once Internet Explorer recognises HTML5 natively
|
||||
*/
|
||||
|
||||
echo (($_GET['msie'] == 1) ? '<div>' : '<section>');
|
||||
echo "<section>";
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -53,7 +53,7 @@ function update_profile_content(&$a) {
|
|||
*/
|
||||
|
||||
echo str_replace("\t",' ',$text);
|
||||
echo (($_GET['msie'] == 1) ? '</div>' : '</section>');
|
||||
echo "</section>";
|
||||
echo "</body></html>\r\n";
|
||||
killme();
|
||||
|
||||
|
|
|
@ -77,13 +77,45 @@ function wall_upload_post(&$a) {
|
|||
$filetype = $_FILES['userfile']['type'];
|
||||
}
|
||||
elseif(x($_FILES,'media')) {
|
||||
$src = $_FILES['media']['tmp_name'];
|
||||
$filename = basename($_FILES['media']['name']);
|
||||
$filesize = intval($_FILES['media']['size']);
|
||||
$filetype = $_FILES['media']['type'];
|
||||
if (is_array($_FILES['media']['tmp_name']))
|
||||
$src = $_FILES['media']['tmp_name'][0];
|
||||
else
|
||||
$src = $_FILES['media']['tmp_name'];
|
||||
|
||||
if (is_array($_FILES['media']['name']))
|
||||
$filename = basename($_FILES['media']['name'][0]);
|
||||
else
|
||||
$filename = basename($_FILES['media']['name']);
|
||||
|
||||
if (is_array($_FILES['media']['size']))
|
||||
$filesize = intval($_FILES['media']['size'][0]);
|
||||
else
|
||||
$filesize = intval($_FILES['media']['size']);
|
||||
|
||||
if (is_array($_FILES['media']['type']))
|
||||
$filetype = $_FILES['media']['type'][0];
|
||||
else
|
||||
$filetype = $_FILES['media']['type'];
|
||||
}
|
||||
|
||||
if ($filetype=="") $filetype=guess_image_type($filename);
|
||||
|
||||
// This is a special treatment for picture upload from Twidere
|
||||
if (($filename == "octet-stream") AND ($filetype != "")) {
|
||||
$filename = $filetype;
|
||||
$filetype = "";
|
||||
}
|
||||
|
||||
if ($filetype=="")
|
||||
$filetype=guess_image_type($filename);
|
||||
|
||||
// If there is a temp name, then do a manual check
|
||||
// This is more reliable than the provided value
|
||||
$imagedata = getimagesize($src);
|
||||
if ($imagedata)
|
||||
$filetype = $imagedata['mime'];
|
||||
|
||||
logger("File upload src: ".$src." - filename: ".$filename.
|
||||
" - size: ".$filesize." - type: ".$filetype, LOGGER_DEBUG);
|
||||
|
||||
$maximagesize = get_config('system','maximagesize');
|
||||
|
||||
if(($maximagesize) && ($filesize > $maximagesize)) {
|
||||
|
@ -120,14 +152,16 @@ function wall_upload_post(&$a) {
|
|||
$max_length = get_config('system','max_image_length');
|
||||
if(! $max_length)
|
||||
$max_length = MAX_IMAGE_LENGTH;
|
||||
if($max_length > 0)
|
||||
if($max_length > 0) {
|
||||
$ph->scaleImage($max_length);
|
||||
logger("File upload: Scaling picture to new size ".$max_length, LOGGER_DEBUG);
|
||||
}
|
||||
|
||||
$width = $ph->getWidth();
|
||||
$height = $ph->getHeight();
|
||||
|
||||
$hash = photo_new_resource();
|
||||
|
||||
|
||||
$smallest = 0;
|
||||
|
||||
$defperm = '<' . $default_cid . '>';
|
||||
|
@ -142,14 +176,14 @@ function wall_upload_post(&$a) {
|
|||
if($width > 640 || $height > 640) {
|
||||
$ph->scaleImage(640);
|
||||
$r = $ph->store($page_owner_uid, $visitor, $hash, $filename, t('Wall Photos'), 1, 0, $defperm);
|
||||
if($r)
|
||||
if($r)
|
||||
$smallest = 1;
|
||||
}
|
||||
|
||||
if($width > 320 || $height > 320) {
|
||||
$ph->scaleImage(320);
|
||||
$r = $ph->store($page_owner_uid, $visitor, $hash, $filename, t('Wall Photos'), 2, 0, $defperm);
|
||||
if($r)
|
||||
if($r AND ($smallest == 0))
|
||||
$smallest = 2;
|
||||
}
|
||||
|
||||
|
@ -168,7 +202,7 @@ function wall_upload_post(&$a) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
$m = '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]";
|
||||
$m = '[url='.$a->get_baseurl().'/photos/'.$page_owner_nick.'/image/'.$hash.'][img]'.$a->get_baseurl()."/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]";
|
||||
return($m);
|
||||
}
|
||||
/* mod Waitman Gobble NO WARRANTY */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue