This commit is contained in:
zotlabs 2019-11-07 14:48:44 -08:00
commit 839c6668cf
5 changed files with 279 additions and 181 deletions

View File

@ -87,8 +87,8 @@ class Activity {
$headers = [ $headers = [
'Accept' => 'application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"', 'Accept' => 'application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
'Host' => $m['host'], 'Host' => $m['host'],
'(request-target)' => 'get ' . get_request_string($url), 'Date' => datetime_convert('UTC','UTC', 'now', 'D, d M Y h:i:s \\G\\M\\T'),
'Date' => datetime_convert('UTC','UTC','now','D, d M Y H:i:s') . ' UTC' '(request-target)' => 'get ' . get_request_string($url)
]; ];
if (isset($token)) { if (isset($token)) {
$headers['Authorization'] = 'Bearer ' . $token; $headers['Authorization'] = 'Bearer ' . $token;
@ -401,26 +401,30 @@ class Activity {
$ret = []; $ret = [];
if($item['tag']) { if ($item['tag'] && is_array($item['tag'])) {
foreach($item['tag'] as $t) { $ptr = $item['tag'];
if(! array_key_exists('type',$t)) if (! array_key_exists(0,$ptr)) {
$ptr = [ $ptr ];
}
foreach ($ptr as $t) {
if (! array_key_exists('type',$t))
$t['type'] = 'Hashtag'; $t['type'] = 'Hashtag';
switch($t['type']) { switch($t['type']) {
case 'Hashtag': case 'Hashtag':
$ret[] = [ 'ttype' => TERM_HASHTAG, 'url' => ((isset($t['href'])) ? $t['href'] : $t['id']), 'term' => escape_tags((substr($t['name'],0,1) === '#') ? substr($t['name'],1) : $t['name']) ]; $ret[] = [ 'ttype' => TERM_HASHTAG, 'url' => $t['href'], 'term' => escape_tags((substr($t['name'],0,1) === '#') ? substr($t['name'],1) : $t['name']) ];
break; break;
case 'Mention': case 'Mention':
$mention_type = substr($t['name'],0,1); $mention_type = substr($t['name'],0,1);
if($mention_type === '!') { if ($mention_type === '!') {
$ret[] = [ 'ttype' => TERM_FORUM, 'url' => $t['href'], 'term' => escape_tags(substr($t['name'],1)) ]; $ret[] = [ 'ttype' => TERM_FORUM, 'url' => $t['href'], 'term' => escape_tags(substr($t['name'],1)) ];
} }
else { else {
$ret[] = [ 'ttype' => TERM_MENTION, 'url' => $t['href'], 'term' => escape_tags((substr($t['name'],0,1) === '@') ? substr($t['name'],1) : $t['name']) ]; $ret[] = [ 'ttype' => TERM_MENTION, 'url' => $t['href'], 'term' => escape_tags((substr($t['name'],0,1) === '@') ? substr($t['name'],1) : $t['name']) ];
} }
break; break;
default: default:
break; break;
} }
@ -431,6 +435,7 @@ class Activity {
} }
static function encode_taxonomy($item) { static function encode_taxonomy($item) {
$ret = []; $ret = [];

View File

@ -221,7 +221,7 @@ class Photo extends \Zotlabs\Web\Controller {
header_remove('Pragma'); header_remove('Pragma');
if($_SERVER['HTTP_IF_NONE_MATCH'] === $etag || $_SERVER['HTTP_IF_MODIFIED_SINCE'] === gmdate("D, d M Y H:i:s", $modified) . " GMT") { if((isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] === $etag) || (!isset($_SERVER['HTTP_IF_NONE_MATCH']) && isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] === gmdate("D, d M Y H:i:s", $modified) . " GMT")) {
header_remove('Expires'); header_remove('Expires');
header_remove('Cache-Control'); header_remove('Cache-Control');
header_remove('Set-Cookie'); header_remove('Set-Cookie');

View File

@ -449,6 +449,18 @@ function get_atom_elements($feed, $item) {
if (title_is_body($res['title'], $res['body'])) if (title_is_body($res['title'], $res['body']))
$res['title'] = ""; $res['title'] = "";
else {
$res['title'] = bbcode($res['title'], [ 'tryoembed' => false ]);
$res['title'] = html2plain($res['title'], 0, true);
$res['title'] = html_entity_decode($res['title'], ENT_QUOTES, 'UTF-8');
$res['title'] = preg_replace("/https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@]+/", "", $res['title']);
while (strpos($res['title'], "\n") !== false)
$res['title'] = str_replace("\n", " ", $res['title']);
while (strpos($res['title'], " ") !== false)
$res['title'] = str_replace(" ", " ", $res['title']);
$res['title'] = trim($res['title']);
}
if($res['plink']) if($res['plink'])
$base_url = implode('/', array_slice(explode('/',$res['plink']),0,3)); $base_url = implode('/', array_slice(explode('/',$res['plink']),0,3));

File diff suppressed because it is too large Load Diff

View File

@ -465,6 +465,7 @@ App::$strings["Help:"] = "Помощь:";
App::$strings["Help"] = "Помощь"; App::$strings["Help"] = "Помощь";
App::$strings["Not Found"] = "Не найдено"; App::$strings["Not Found"] = "Не найдено";
App::$strings["Page not found."] = "Страница не найдена."; App::$strings["Page not found."] = "Страница не найдена.";
App::$strings["This is the home page of %s."] = "Это домашняя страница %s.";
App::$strings["Image/photo"] = "Изображение / фотография"; App::$strings["Image/photo"] = "Изображение / фотография";
App::$strings["Encrypted content"] = "Зашифрованное содержание"; App::$strings["Encrypted content"] = "Зашифрованное содержание";
App::$strings["Install %1\$s element %2\$s"] = "Установить %1\$s элемент %2\$s"; App::$strings["Install %1\$s element %2\$s"] = "Установить %1\$s элемент %2\$s";
@ -1661,7 +1662,6 @@ App::$strings["Show URL to this file"] = "Показать URL этого фай
App::$strings["Block Name"] = "Название блока"; App::$strings["Block Name"] = "Название блока";
App::$strings["Edit Block"] = "Редактировать блок"; App::$strings["Edit Block"] = "Редактировать блок";
App::$strings["No service class restrictions found."] = "Ограничений класса обслуживание не найдено."; App::$strings["No service class restrictions found."] = "Ограничений класса обслуживание не найдено.";
App::$strings["This is the home page of %s."] = "Это домашняя страница %s.";
App::$strings["Insufficient permissions. Request redirected to profile page."] = "Недостаточно прав. Запрос перенаправлен на страницу профиля."; App::$strings["Insufficient permissions. Request redirected to profile page."] = "Недостаточно прав. Запрос перенаправлен на страницу профиля.";
App::$strings["Channel Export App"] = "Приложение \"Экспорт канала\""; App::$strings["Channel Export App"] = "Приложение \"Экспорт канала\"";
App::$strings["Export your channel"] = "Экспортировать ваш канал"; App::$strings["Export your channel"] = "Экспортировать ваш канал";
@ -2962,18 +2962,20 @@ App::$strings["IRC Settings"] = "Настройки IRC";
App::$strings["IRC settings saved."] = "Настройки IRC сохранены"; App::$strings["IRC settings saved."] = "Настройки IRC сохранены";
App::$strings["IRC Chatroom"] = "Чат IRC"; App::$strings["IRC Chatroom"] = "Чат IRC";
App::$strings["Your account on %s will expire in a few days."] = "Ваш аккаунт на %s перестанет работать через несколько дней."; App::$strings["Your account on %s will expire in a few days."] = "Ваш аккаунт на %s перестанет работать через несколько дней.";
App::$strings["Your $Productname test account is about to expire."] = "Ваш тестовый аккаунт в $Productname близок к окончанию срока действия."; App::$strings["Your $Productname test account is about to expire."] = "Ваша тестовая учётная запись в $Productname близка к окончанию срока действия.";
App::$strings["Friendica Photo Album Import"] = "Импортировать альбом фотографий Friendica"; App::$strings["Friendica Photo Album Import"] = "Импортировать альбом фотографий Friendica";
App::$strings["This will import all your Friendica photo albums to this Red channel."] = "Это позволит импортировать все ваши альбомы фотографий Friendica в этот канал."; App::$strings["This will import all your Friendica photo albums to this Red channel."] = "Это позволит импортировать все ваши альбомы фотографий Friendica в этот канал.";
App::$strings["Friendica Server base URL"] = "Базовый URL сервера Friendica"; App::$strings["Friendica Server base URL"] = "Базовый URL сервера Friendica";
App::$strings["Friendica Login Username"] = "Имя пользователя для входа Friendica"; App::$strings["Friendica Login Username"] = "Имя пользователя для входа Friendica";
App::$strings["Friendica Login Password"] = "Пароль для входа Firendica"; App::$strings["Friendica Login Password"] = "Пароль для входа Firendica";
App::$strings["Post to Livejournal"] = "Опубликовать в Livejournal"; App::$strings["Post to Livejournal"] = "Опубликовать в Livejournal";
App::$strings["Posted by"] = "Опубликовано";
App::$strings["Livejournal Crosspost Connector App"] = "Приложение \"Публикация в Livejournal\""; App::$strings["Livejournal Crosspost Connector App"] = "Приложение \"Публикация в Livejournal\"";
App::$strings["Relay public posts to Livejournal"] = "Пересылает общедоступные публикации в Livejournal"; App::$strings["Relay public posts to Livejournal"] = "Пересылает общедоступные публикации в Livejournal";
App::$strings["Livejournal username"] = "Имя пользователя Livejournal"; App::$strings["Livejournal username"] = "Имя пользователя Livejournal";
App::$strings["Livejournal password"] = "Пароль Livejournal"; App::$strings["Livejournal password"] = "Пароль Livejournal";
App::$strings["Post to Livejournal by default"] = "Публиковать в Livejournal по умолчанию"; App::$strings["Post to Livejournal by default"] = "Публиковать в Livejournal по умолчанию";
App::$strings["Send wall-to-wall posts to Livejournal"] = "Отправлять публикации на стене в Livejournal";
App::$strings["Livejournal Crosspost Connector"] = "Публикация в Livejournal"; App::$strings["Livejournal Crosspost Connector"] = "Публикация в Livejournal";
App::$strings["Random Planet App"] = "Приложение \"Случайная планета\""; App::$strings["Random Planet App"] = "Приложение \"Случайная планета\"";
App::$strings["Installed"] = "Установлено"; App::$strings["Installed"] = "Установлено";
@ -3471,6 +3473,17 @@ App::$strings["No Federation App"] = "Приложение No Federation";
App::$strings["Prevent posting from being federated to anybody. It will exist only on your channel page."] = "Запрещает федеративные функций для публикаций. Они будут существовать только на странице вашего канала."; App::$strings["Prevent posting from being federated to anybody. It will exist only on your channel page."] = "Запрещает федеративные функций для публикаций. Они будут существовать только на странице вашего канала.";
App::$strings["Federate posts by default"] = "Разрешить федерацию публикаций по умолчанию"; App::$strings["Federate posts by default"] = "Разрешить федерацию публикаций по умолчанию";
App::$strings["No Federation"] = "Отключить Federation"; App::$strings["No Federation"] = "Отключить Federation";
App::$strings["Workflow Settings"] = "Настройки \"Рабочего процесса\"";
App::$strings["Workflow user."] = "Пользователь \"Рабочего процесса\".";
App::$strings["This channel"] = "Этот канал";
App::$strings["Workflow"] = "Рабочий процесс";
App::$strings["Add item to which workflow"] = "Подключить рабочий процесс к элементу";
App::$strings["Create Workflow Item"] = "Создать элемент рабочего процесса";
App::$strings["Link"] = "Ссылка";
App::$strings["Web link."] = "Веб-ссылка.";
App::$strings["Brief description or title"] = "Подробное описание или заголовок";
App::$strings["Notes and Info"] = "Замечания и информация";
App::$strings["Body"] = "Текст";
App::$strings["TOTP Two-Step Verification"] = "Двухэтапная верификация TOTP"; App::$strings["TOTP Two-Step Verification"] = "Двухэтапная верификация TOTP";
App::$strings["Enter the 2-step verification generated by your authenticator app:"] = "Введите код проверки, созданный вашим приложением для аутентификации"; App::$strings["Enter the 2-step verification generated by your authenticator app:"] = "Введите код проверки, созданный вашим приложением для аутентификации";
App::$strings["Success!"] = "Успех!"; App::$strings["Success!"] = "Успех!";