Merge branch 'master' into develop

This commit is contained in:
Tobias Diekershoff 2017-03-12 14:39:09 +01:00
commit 4cddb74f27
18 changed files with 13057 additions and 12854 deletions

View file

@ -1,4 +1,4 @@
Version 3.5.1 Version 3.5.1 (2017-03-12)
Friendica Core: Friendica Core:
Updates to the translations (BG, CA, CS, DE, EO, ES, FR, IS, IT, NL, PL, PT-BR, RU, SV) [translation teams] Updates to the translations (BG, CA, CS, DE, EO, ES, FR, IS, IT, NL, PL, PT-BR, RU, SV) [translation teams]
Fix for a potential XSS vector [heluecht, thanks to Vít Šesták 'v6ak' for reporting the problem] Fix for a potential XSS vector [heluecht, thanks to Vít Šesták 'v6ak' for reporting the problem]
@ -33,13 +33,13 @@ Version 3.5.1
ping now works with JSON as well [Hypolite] ping now works with JSON as well [Hypolite]
On pending registrations, an email is now send to inform the user about it [tobiasd] On pending registrations, an email is now send to inform the user about it [tobiasd]
On systems where the registration needs approval, a note for the admin can now be written [tobiasd] On systems where the registration needs approval, a note for the admin can now be written [tobiasd]
Theme developers can now announce if their theme does support the RichText editor or not [heluecht, rabuzarus]
Meta Information for HTML descriptions is now limited to 160 character [rabuzarus] Meta Information for HTML descriptions is now limited to 160 character [rabuzarus]
Removed very old deprecated themes from the repository [silke] Removed very old deprecated themes from the repository [silke]
Marked frost and frost mobile as deprecated [silke] Marked frost and frost mobile as deprecated [silke]
When creating new postings in the UI, focus is automatically put into the Title field [Hypolite] When creating new postings in the UI, focus is automatically put into the Title field [Hypolite]
We are now shipping config files for "tx" (the Transifex client) and the "EditorConfig" addon for many common editors [fabrixxm, tobiasd] We are now shipping config files for "tx" (the Transifex client) and the "EditorConfig" addon for many common editors [fabrixxm, tobiasd]
The TinyMCE richtext editor was removed [Hypolite] The TinyMCE richtext editor was removed [Hypolite]
We defined a coding style, PSR-2 with some adjustments
Various bugfixes Various bugfixes
Friendica Addons: Friendica Addons:
@ -58,11 +58,12 @@ Version 3.5.1
Twitter-bridge now supports quotes and long posts when importing tweets [heluecht] Twitter-bridge now supports quotes and long posts when importing tweets [heluecht]
Closed Issues Closed Issues
1019, 1163, 1612, 1613, 2177, 2252, 2260, 2403, 2991, 2614, 2751, 1019, 1163, 1612, 1613, 2103, 2177, 2252, 2260, 2403, 2991, 2614,
2752, 2772, 2791, 2800, 2804, 2813, 2814, 2816, 2817, 2823, 2850, 2751, 2752, 2772, 2791, 2800, 2804, 2813, 2814, 2816, 2817, 2823,
2858, 2865, 2892, 2894, 2895, 2907, 2908, 2914, 2015, 2926, 2948, 2850, 2858, 2865, 2892, 2894, 2895, 2907, 2908, 2914, 2015, 2926,
2955, 2958, 2963, 2964, 2968, 2987, 2993, 3020, 3052, 3062, 3066, 2948, 2955, 2958, 2963, 2964, 2968, 2987, 2993, 3020, 3052, 3062,
3091, 3108, 3116, 3117, 3118, 3126, 3130, 3135, 3155, 3163 3066, 3091, 3108, 3113, 3116, 3117, 3118, 3126, 3130, 3135, 3155,
3160, 3163, 3187, 3196
Version 3.5 (2016-09-13) Version 3.5 (2016-09-13)
Friendica Core: Friendica Core:

1
VERSION Normal file
View file

@ -0,0 +1 @@
3.5.1

View file

@ -38,9 +38,9 @@ require_once('include/dbstructure.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_CODENAME', 'Asparagus'); define ( 'FRIENDICA_CODENAME', 'Asparagus');
define ( 'FRIENDICA_VERSION', '3.5.1-dev' ); define ( 'FRIENDICA_VERSION', '3.5.1' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1214 ); define ( 'DB_UPDATE_VERSION', 1215 );
/** /**
* @brief Constant with a HTML line break. * @brief Constant with a HTML line break.

View file

@ -1,6 +1,6 @@
-- ------------------------------------------ -- ------------------------------------------
-- Friendica 3.5.1-dev (Asparagus) -- Friendica 3.5.1-rc (Asparagus)
-- DB_UPDATE_VERSION 1213 -- DB_UPDATE_VERSION 1215
-- ------------------------------------------ -- ------------------------------------------
@ -532,6 +532,7 @@ CREATE TABLE IF NOT EXISTS `item` (
INDEX `parent-uri` (`parent-uri`), INDEX `parent-uri` (`parent-uri`),
INDEX `extid` (`extid`), INDEX `extid` (`extid`),
INDEX `uid_id` (`uid`,`id`), INDEX `uid_id` (`uid`,`id`),
INDEX `uid_contactid_id` (`uid`,`contact-id`,`id`),
INDEX `uid_created` (`uid`,`created`), INDEX `uid_created` (`uid`,`created`),
INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`), INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
INDEX `uid_network_received` (`uid`,`network`,`received`), INDEX `uid_network_received` (`uid`,`network`,`received`),
@ -1016,7 +1017,8 @@ CREATE TABLE IF NOT EXISTS `thread` (
INDEX `uid_contactid_commented` (`uid`,`contact-id`,`commented`), INDEX `uid_contactid_commented` (`uid`,`contact-id`,`commented`),
INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`), INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`),
INDEX `uid_created` (`uid`,`created`), INDEX `uid_created` (`uid`,`created`),
INDEX `uid_commented` (`uid`,`commented`) INDEX `uid_commented` (`uid`,`commented`),
INDEX `uid_wall_created` (`uid`,`wall`,`created`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
-- --

View file

@ -61,6 +61,8 @@ Here's a few primers if you are new to Friendica or to the PSR-2 coding standard
Don't worry, you don't have to know by heart the PSR-2 coding standards to start contributing to Friendica. Don't worry, you don't have to know by heart the PSR-2 coding standards to start contributing to Friendica.
There are a few tools you can use to check or fix your files before you commit. There are a few tools you can use to check or fix your files before you commit.
For documentation we use the standard of *one sentence per line* for the `md` files in the `/doc` and `/doc/$lng` subdirectories.
####Check with [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) ####Check with [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer)
This tool checks your files against a variety of coding standards, including PSR-2, and ouputs a report of all the standard violations. This tool checks your files against a variety of coding standards, including PSR-2, and ouputs a report of all the standard violations.

View file

@ -146,7 +146,9 @@ class ParseUrl {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent()); curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false)); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (($check_cert) ? 2 : false)); if ($check_cert) {
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
}
$header = curl_exec($ch); $header = curl_exec($ch);
$curl_info = @curl_getinfo($ch); $curl_info = @curl_getinfo($ch);

View file

@ -242,7 +242,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
if (!isset($database[$name]["fields"][$fieldname])) { if (!isset($database[$name]["fields"][$fieldname])) {
$sql2=db_add_table_field($fieldname, $parameters); $sql2=db_add_table_field($fieldname, $parameters);
if ($sql3 == "") { if ($sql3 == "") {
$sql3 = "ALTER TABLE `".$temp_name."` ".$sql2; $sql3 = "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
} else { } else {
$sql3 .= ", ".$sql2; $sql3 .= ", ".$sql2;
} }
@ -253,7 +253,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
if ($current_field_definition != $new_field_definition) { if ($current_field_definition != $new_field_definition) {
$sql2=db_modify_table_field($fieldname, $parameters); $sql2=db_modify_table_field($fieldname, $parameters);
if ($sql3 == "") { if ($sql3 == "") {
$sql3 = "ALTER TABLE `".$temp_name."` ".$sql2; $sql3 = "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
} else { } else {
$sql3 .= ", ".$sql2; $sql3 .= ", ".$sql2;
} }
@ -1526,6 +1526,7 @@ function db_definition($charset) {
"uid_contactid_created" => array("uid","contact-id","created"), "uid_contactid_created" => array("uid","contact-id","created"),
"uid_created" => array("uid","created"), "uid_created" => array("uid","created"),
"uid_commented" => array("uid","commented"), "uid_commented" => array("uid","commented"),
"uid_wall_created" => array("uid","wall","created"),
) )
); );
$database["tokens"] = array( $database["tokens"] = array(

View file

@ -186,6 +186,10 @@ function discover_directory($search) {
*/ */
function gs_search_user($search) { function gs_search_user($search) {
// Currently disabled, since the service isn't available anymore.
// It is not removed since I hope that there will be a successor.
return false;
$a = get_app(); $a = get_app();
$url = "http://gstools.org/api/users_search/".urlencode($search); $url = "http://gstools.org/api/users_search/".urlencode($search);

View file

@ -118,7 +118,9 @@ function z_fetch_url($url,$binary = false, &$redirects = 0, $opts=array()) {
$check_cert = get_config('system','verifyssl'); $check_cert = get_config('system','verifyssl');
@curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false)); @curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (($check_cert) ? 2 : false)); if ($check_cert) {
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
}
$prx = get_config('system','proxy'); $prx = get_config('system','proxy');
if(strlen($prx)) { if(strlen($prx)) {
@ -265,7 +267,9 @@ function post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0)
$check_cert = get_config('system','verifyssl'); $check_cert = get_config('system','verifyssl');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false)); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (($check_cert) ? 2 : false)); if ($check_cert) {
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
}
$prx = get_config('system','proxy'); $prx = get_config('system','proxy');
if(strlen($prx)) { if(strlen($prx)) {
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);

View file

@ -11,7 +11,6 @@ if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
} }
use \Friendica\Core\Config; use \Friendica\Core\Config;
use \Friendica\Core\PConfig;
require_once("boot.php"); require_once("boot.php");
@ -29,6 +28,8 @@ function poller_run($argv, $argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
Config::load();
// Quit when in maintenance // Quit when in maintenance
if (Config::get('system', 'maintenance', true)) { if (Config::get('system', 'maintenance', true)) {
return; return;

View file

@ -1244,18 +1244,20 @@ function poco_discover_federation() {
poco_check_server("https://".$server->host); poco_check_server("https://".$server->host);
} }
// Discover GNU Social Servers // Currently disabled, since the service isn't available anymore.
if (!get_config('system','ostatus_disabled')) { // It is not removed since I hope that there will be a successor.
$serverdata = "http://gstools.org/api/get_open_instances/"; // Discover GNU Social Servers.
//if (!get_config('system','ostatus_disabled')) {
// $serverdata = "http://gstools.org/api/get_open_instances/";
$result = z_fetch_url($serverdata); // $result = z_fetch_url($serverdata);
if ($result["success"]) { // if ($result["success"]) {
$servers = json_decode($result["body"]); // $servers = json_decode($result["body"]);
foreach($servers->data AS $server) // foreach($servers->data AS $server)
poco_check_server($server->instance_address); // poco_check_server($server->instance_address);
} // }
} //}
set_config('poco','last_federation_discovery', time()); set_config('poco','last_federation_discovery', time());
} }

View file

@ -194,10 +194,14 @@ function notifications_content(App $a) {
if($it['network'] === NETWORK_DFRN) { if($it['network'] === NETWORK_DFRN) {
$lbl_knowyou = t('Claims to be known to you: '); $lbl_knowyou = t('Claims to be known to you: ');
$knowyou = (($it['knowyou']) ? t('yes') : t('no')); $knowyou = (($it['knowyou']) ? t('yes') : t('no'));
$helptext = t('Shall your connection be bidirectional or not? "Friend" implies that you allow to read and you subscribe to their posts. "Fan/Admirer" means that you allow to read but you do not want to read theirs. Approve as: '); $helptext = t('Shall your connection be bidirectional or not?');
$helptext2 = sprintf(t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.'), $it['name'], $it['name']);
$helptext3 = sprintf(t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.'), $it['name']);
} else { } else {
$knowyou = ''; $knowyou = '';
$helptext = t('Shall your connection be bidirectional or not? "Friend" implies that you allow to read and you subscribe to their posts. "Sharer" means that you allow to read but you do not want to read theirs. Approve as: '); $helptext = t('Shall your connection be bidirectional or not?');
$helptext2 = sprintf(t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.'), $it['name'], $it['name']);
$helptext3 = sprintf(t('Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed.'), $it['name']);
} }
} }
@ -205,9 +209,11 @@ function notifications_content(App $a) {
'$intro_id' => $it['intro_id'], '$intro_id' => $it['intro_id'],
'$friend_selected' => $friend_selected, '$friend_selected' => $friend_selected,
'$fan_selected' => $fan_selected, '$fan_selected' => $fan_selected,
'$approve_as' => $helptext, '$approve_as1' => $helptext,
'$approve_as2' => $helptext2,
'$approve_as3' => $helptext3,
'$as_friend' => t('Friend'), '$as_friend' => t('Friend'),
'$as_fan' => (($it['network'] == NETWORK_DIASPORA) ? t('Sharer') : t('Fan/Admirer')) '$as_fan' => (($it['network'] == NETWORK_DIASPORA) ? t('Sharer') : t('Subscriber'))
)); ));
$header = $it["name"]; $header = $it["name"];

View file

@ -240,6 +240,17 @@ function profile_content(App $a, $update = 0) {
$sql_extra2 .= protect_sprintf(sprintf(" AND `thread`.`created` >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2)))); $sql_extra2 .= protect_sprintf(sprintf(" AND `thread`.`created` >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2))));
} }
// Belongs the profile page to a forum?
// If not then we can improve the performance with an additional condition
$r = q("SELECT `uid` FROM `user` WHERE `uid` = %d AND `page-flags` IN (%d, %d)",
intval($a->profile['profile_uid']),
intval(PAGE_COMMUNITY),
intval(PAGE_PRVGROUP));
if (!dbm::is_result($r)) {
$sql_extra3 = sprintf(" AND `thread`.`contact-id` = %d ", intval(intval($a->profile['contact_id'])));
}
if(get_config('system', 'old_pager')) { if(get_config('system', 'old_pager')) {
$r = q("SELECT COUNT(*) AS `total` $r = q("SELECT COUNT(*) AS `total`
FROM `thread` INNER JOIN `item` ON `item`.`id` = `thread`.`iid` FROM `thread` INNER JOIN `item` ON `item`.`id` = `thread`.`iid`
@ -248,7 +259,7 @@ function profile_content(App $a, $update = 0) {
WHERE `thread`.`uid` = %d AND `thread`.`visible` = 1 AND `thread`.`deleted` = 0 WHERE `thread`.`uid` = %d AND `thread`.`visible` = 1 AND `thread`.`deleted` = 0
and `thread`.`moderated` = 0 and `thread`.`moderated` = 0
AND `thread`.`wall` = 1 AND `thread`.`wall` = 1
$sql_extra $sql_extra2 ", $sql_extra3 $sql_extra $sql_extra2 ",
intval($a->profile['profile_uid']) intval($a->profile['profile_uid'])
); );
@ -282,14 +293,12 @@ function profile_content(App $a, $update = 0) {
STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id` STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
AND NOT `contact`.`blocked` AND NOT `contact`.`pending` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
WHERE `thread`.`uid` = %d AND `thread`.`visible` WHERE `thread`.`uid` = %d AND `thread`.`visible`
AND `thread`.`contact-id` = %d
AND NOT `thread`.`deleted` AND NOT `thread`.`deleted`
AND NOT `thread`.`moderated` AND NOT `thread`.`moderated`
AND `thread`.`wall` AND `thread`.`wall`
$sql_extra $sql_extra2 $sql_extra3 $sql_extra $sql_extra2
ORDER BY `thread`.`created` DESC $pager_sql", ORDER BY `thread`.`created` DESC $pager_sql",
intval($a->profile['profile_uid']), intval($a->profile['profile_uid'])
intval($a->profile['contact_id'])
); );
} }

View file

@ -1,6 +1,6 @@
<?php <?php
define('UPDATE_VERSION' , 1214); define('UPDATE_VERSION' , 1215);
/** /**
* *

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,9 @@
<div class="intro-approve-as-friend-desc">{{$approve_as}}</div> <div class="intro-approve-as-friend-desc">
<p>{{$approve_as1}}</p>
<p>{{$approve_as2}}</p>
<p>{{$approve_as3}}</p>
</div>
<div class="intro-approve-as-friend-wrapper"> <div class="intro-approve-as-friend-wrapper">
<label class="intro-approve-as-friend-label" for="intro-approve-as-friend-{{$intro_id}}">{{$as_friend}}</label> <label class="intro-approve-as-friend-label" for="intro-approve-as-friend-{{$intro_id}}">{{$as_friend}}</label>