Compare commits
No commits in common. "2025.07-rc" and "Art4/fix-phpstan-error-level-2" have entirely different histories.
2025.07-rc
...
Art4/fix-p
142 changed files with 3789 additions and 3681 deletions
|
@ -1,6 +1,6 @@
|
||||||
skip_clone: true
|
skip_clone: true
|
||||||
|
|
||||||
steps:
|
pipeline:
|
||||||
clone_friendica_base:
|
clone_friendica_base:
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
|
@ -56,10 +56,6 @@ steps:
|
||||||
- /tmp/drone-cache:/tmp/cache
|
- /tmp/drone-cache:/tmp/cache
|
||||||
when:
|
when:
|
||||||
event: pull_request
|
event: pull_request
|
||||||
phpstan:
|
|
||||||
image: friendicaci/php8.3:php8.3.3
|
|
||||||
commands:
|
|
||||||
- ./bin/composer.phar run phpstan;
|
|
||||||
check:
|
check:
|
||||||
image: friendicaci/php-cs
|
image: friendicaci/php-cs
|
||||||
commands:
|
commands:
|
||||||
|
|
|
@ -5,7 +5,7 @@ labels:
|
||||||
|
|
||||||
skip_clone: true
|
skip_clone: true
|
||||||
|
|
||||||
steps:
|
pipeline:
|
||||||
clone_friendica_base:
|
clone_friendica_base:
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
|
@ -48,7 +48,7 @@ steps:
|
||||||
branch: [ develop, '*-rc' ]
|
branch: [ develop, '*-rc' ]
|
||||||
event: push
|
event: push
|
||||||
composer_install:
|
composer_install:
|
||||||
image: friendicaci/php8.2:php8.2.28
|
image: friendicaci/php8.2:php8.2.16
|
||||||
commands:
|
commands:
|
||||||
- export COMPOSER_HOME=.composer
|
- export COMPOSER_HOME=.composer
|
||||||
- composer validate
|
- composer validate
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
skip_clone: true
|
skip_clone: true
|
||||||
|
|
||||||
steps:
|
pipeline:
|
||||||
clone_friendica_base:
|
clone_friendica_base:
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
|
|
|
@ -5,13 +5,11 @@ matrix:
|
||||||
- PHP_MAJOR_VERSION: 8.0
|
- PHP_MAJOR_VERSION: 8.0
|
||||||
PHP_VERSION: 8.0.30
|
PHP_VERSION: 8.0.30
|
||||||
- PHP_MAJOR_VERSION: 8.1
|
- PHP_MAJOR_VERSION: 8.1
|
||||||
PHP_VERSION: 8.1.31
|
PHP_VERSION: 8.1.27
|
||||||
- PHP_MAJOR_VERSION: 8.2
|
- PHP_MAJOR_VERSION: 8.2
|
||||||
PHP_VERSION: 8.2.28
|
PHP_VERSION: 8.2.16
|
||||||
- PHP_MAJOR_VERSION: 8.3
|
- PHP_MAJOR_VERSION: 8.3
|
||||||
PHP_VERSION: 8.3.17
|
PHP_VERSION: 8.3.3
|
||||||
- PHP_MAJOR_VERSION: 8.4
|
|
||||||
PHP_VERSION: 8.4.5
|
|
||||||
|
|
||||||
# This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
|
# This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
|
||||||
labels:
|
labels:
|
||||||
|
@ -19,7 +17,7 @@ labels:
|
||||||
|
|
||||||
skip_clone: true
|
skip_clone: true
|
||||||
|
|
||||||
steps:
|
pipeline:
|
||||||
clone_friendica_base:
|
clone_friendica_base:
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
|
@ -100,9 +98,9 @@ steps:
|
||||||
- friendica/friendica-addons
|
- friendica/friendica-addons
|
||||||
commands:
|
commands:
|
||||||
- codecov -R '.' -Z -f 'clover.xml'
|
- codecov -R '.' -Z -f 'clover.xml'
|
||||||
environment:
|
secrets:
|
||||||
CODECOV_TOKEN:
|
- source: codecov-token
|
||||||
from_secret: codecov-token
|
target: codecov_token
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mariadb:
|
mariadb:
|
||||||
|
|
|
@ -5,7 +5,7 @@ labels:
|
||||||
|
|
||||||
skip_clone: true
|
skip_clone: true
|
||||||
|
|
||||||
steps:
|
pipeline:
|
||||||
clone_friendica_base:
|
clone_friendica_base:
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
|
@ -45,7 +45,7 @@ steps:
|
||||||
repo: friendica/friendica-addons
|
repo: friendica/friendica-addons
|
||||||
event: tag
|
event: tag
|
||||||
composer_install:
|
composer_install:
|
||||||
image: friendicaci/php8.2:php8.2.28
|
image: friendicaci/php8.2:php8.2.16
|
||||||
commands:
|
commands:
|
||||||
- export COMPOSER_HOME=.composer
|
- export COMPOSER_HOME=.composer
|
||||||
- composer validate
|
- composer validate
|
||||||
|
|
|
@ -33,13 +33,16 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Content\Text\Markdown;
|
use Friendica\Content\Text\Markdown;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBStructure;
|
use Friendica\Database\DBStructure;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
use Friendica\Model\Item;
|
||||||
use Friendica\Model\Post;
|
use Friendica\Model\Post;
|
||||||
use Friendica\Model\Tag;
|
use Friendica\Model\Tag;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
|
@ -61,7 +64,7 @@ function advancedcontentfilter_install()
|
||||||
Hook::add('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition');
|
Hook::add('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition');
|
||||||
DBStructure::performUpdate();
|
DBStructure::performUpdate();
|
||||||
|
|
||||||
DI::logger()->notice('installed advancedcontentfilter');
|
Logger::notice('installed advancedcontentfilter');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -120,22 +123,21 @@ function advancedcontentfilter_prepare_body_content_filter(&$hook_data)
|
||||||
$expressionLanguage = new ExpressionLanguage\ExpressionLanguage();
|
$expressionLanguage = new ExpressionLanguage\ExpressionLanguage();
|
||||||
}
|
}
|
||||||
|
|
||||||
$uid = $hook_data['uid'] ?? DI::userSession()->getLocalUserId();
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
if (!$uid) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$vars = advancedcontentfilter_get_filter_fields($hook_data['item']);
|
$vars = advancedcontentfilter_get_filter_fields($hook_data['item']);
|
||||||
|
|
||||||
$rules = DI::cache()->get('rules_' . $uid);
|
$rules = DI::cache()->get('rules_' . DI::userSession()->getLocalUserId());
|
||||||
if (!isset($rules)) {
|
if (!isset($rules)) {
|
||||||
$rules = DBA::toArray(DBA::select(
|
$rules = DBA::toArray(DBA::select(
|
||||||
'advancedcontentfilter_rules',
|
'advancedcontentfilter_rules',
|
||||||
['name', 'expression', 'serialized'],
|
['name', 'expression', 'serialized'],
|
||||||
['uid' => $uid, 'active' => true]
|
['uid' => DI::userSession()->getLocalUserId(), 'active' => true]
|
||||||
));
|
));
|
||||||
|
|
||||||
DI::cache()->set('rules_' . $uid, $rules);
|
DI::cache()->set('rules_' . DI::userSession()->getLocalUserId(), $rules);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($rules) {
|
if ($rules) {
|
||||||
|
@ -271,7 +273,7 @@ function advancedcontentfilter_content()
|
||||||
'rule_expression' => DI::l10n()->t('Rule Expression'),
|
'rule_expression' => DI::l10n()->t('Rule Expression'),
|
||||||
'cancel' => DI::l10n()->t('Cancel'),
|
'cancel' => DI::l10n()->t('Cancel'),
|
||||||
],
|
],
|
||||||
'$current_theme' => DI::appHelper()->getCurrentTheme(),
|
'$current_theme' => DI::app()->getCurrentTheme(),
|
||||||
'$rules' => DBA::toArray(DBA::select('advancedcontentfilter_rules', [], ['uid' => DI::userSession()->getLocalUserId()])),
|
'$rules' => DBA::toArray(DBA::select('advancedcontentfilter_rules', [], ['uid' => DI::userSession()->getLocalUserId()])),
|
||||||
'$form_security_token' => BaseModule::getFormSecurityToken()
|
'$form_security_token' => BaseModule::getFormSecurityToken()
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
* Author: Fabio <https://kirgroup.com/profile/fabrixxm>
|
* Author: Fabio <https://kirgroup.com/profile/fabrixxm>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -26,7 +28,7 @@ function birdavatar_install()
|
||||||
Hook::register('addon_settings', __FILE__, 'birdavatar_addon_settings');
|
Hook::register('addon_settings', __FILE__, 'birdavatar_addon_settings');
|
||||||
Hook::register('addon_settings_post', __FILE__, 'birdavatar_addon_settings_post');
|
Hook::register('addon_settings_post', __FILE__, 'birdavatar_addon_settings_post');
|
||||||
|
|
||||||
DI::logger()->info('registered birdavatar');
|
Logger::info('registered birdavatar');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -44,7 +44,9 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -76,7 +78,7 @@ function blackout_redirect ($b)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (( $date1 <= $now ) && ( $now <= $date2 )) {
|
if (( $date1 <= $now ) && ( $now <= $date2 )) {
|
||||||
DI::logger()->notice('redirecting user to blackout page');
|
Logger::notice('redirecting user to blackout page');
|
||||||
System::externalRedirect($myurl);
|
System::externalRedirect($myurl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Jaybizzle\CrawlerDetect\CrawlerDetect;
|
use Jaybizzle\CrawlerDetect\CrawlerDetect;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Network\HTTPException\ForbiddenException;
|
use Friendica\Network\HTTPException\ForbiddenException;
|
||||||
|
@ -69,7 +70,7 @@ function blockbot_init_1()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($parts)) {
|
if (empty($parts)) {
|
||||||
DI::logger()->debug('Known frontend found - accept', $logdata);
|
Logger::debug('Known frontend found - accept', $logdata);
|
||||||
if ($isCrawler) {
|
if ($isCrawler) {
|
||||||
blockbot_save('badly-parsed-agents', $_SERVER['HTTP_USER_AGENT']);
|
blockbot_save('badly-parsed-agents', $_SERVER['HTTP_USER_AGENT']);
|
||||||
}
|
}
|
||||||
|
@ -79,66 +80,66 @@ function blockbot_init_1()
|
||||||
blockbot_log_activitypub($_SERVER['REQUEST_URI'], $_SERVER['HTTP_USER_AGENT']);
|
blockbot_log_activitypub($_SERVER['REQUEST_URI'], $_SERVER['HTTP_USER_AGENT']);
|
||||||
|
|
||||||
if (blockbot_is_crawler($parts)) {
|
if (blockbot_is_crawler($parts)) {
|
||||||
DI::logger()->debug('Crawler found - reject', $logdata);
|
Logger::debug('Crawler found - reject', $logdata);
|
||||||
blockbot_reject();
|
blockbot_reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockbot_is_searchbot($parts)) {
|
if (blockbot_is_searchbot($parts)) {
|
||||||
DI::logger()->debug('Search bot found - reject', $logdata);
|
Logger::debug('Search bot found - reject', $logdata);
|
||||||
blockbot_reject();
|
blockbot_reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockbot_is_unwanted($parts)) {
|
if (blockbot_is_unwanted($parts)) {
|
||||||
DI::logger()->debug('Uncategorized unwanted agent found - reject', $logdata);
|
Logger::debug('Uncategorized unwanted agent found - reject', $logdata);
|
||||||
blockbot_reject();
|
blockbot_reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockbot_is_security_checker($parts)) {
|
if (blockbot_is_security_checker($parts)) {
|
||||||
if (!DI::config()->get('blockbot', 'security_checker')) {
|
if (!DI::config()->get('blockbot', 'security_checker')) {
|
||||||
DI::logger()->debug('Security checker found - reject', $logdata);
|
Logger::debug('Security checker found - reject', $logdata);
|
||||||
blockbot_reject();
|
blockbot_reject();
|
||||||
}
|
}
|
||||||
DI::logger()->debug('Security checker found - accept', $logdata);
|
Logger::debug('Security checker found - accept', $logdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockbot_is_social_media($parts)) {
|
if (blockbot_is_social_media($parts)) {
|
||||||
DI::logger()->debug('Social media service found - accept', $logdata);
|
Logger::debug('Social media service found - accept', $logdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockbot_is_fediverse_client($parts)) {
|
if (blockbot_is_fediverse_client($parts)) {
|
||||||
DI::logger()->debug('Fediverse client found - accept', $logdata);
|
Logger::debug('Fediverse client found - accept', $logdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockbot_is_feed_reader($parts)) {
|
if (blockbot_is_feed_reader($parts)) {
|
||||||
DI::logger()->debug('Feed reader found - accept', $logdata);
|
Logger::debug('Feed reader found - accept', $logdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockbot_is_fediverse_tool($parts)) {
|
if (blockbot_is_fediverse_tool($parts)) {
|
||||||
DI::logger()->debug('Fediverse tool found - accept', $logdata);
|
Logger::debug('Fediverse tool found - accept', $logdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockbot_is_service_agent($parts)) {
|
if (blockbot_is_service_agent($parts)) {
|
||||||
DI::logger()->debug('Service agent found - accept', $logdata);
|
Logger::debug('Service agent found - accept', $logdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockbot_is_monitor($parts)) {
|
if (blockbot_is_monitor($parts)) {
|
||||||
DI::logger()->debug('Monitoring service found - accept', $logdata);
|
Logger::debug('Monitoring service found - accept', $logdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockbot_is_validator($parts)) {
|
if (blockbot_is_validator($parts)) {
|
||||||
DI::logger()->debug('Validation service found - accept', $logdata);
|
Logger::debug('Validation service found - accept', $logdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockbot_is_good_tool($parts)) {
|
if (blockbot_is_good_tool($parts)) {
|
||||||
DI::logger()->debug('Uncategorized helpful service found - accept', $logdata);
|
Logger::debug('Uncategorized helpful service found - accept', $logdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,10 +147,10 @@ function blockbot_init_1()
|
||||||
if (blockbot_is_http_library($parts)) {
|
if (blockbot_is_http_library($parts)) {
|
||||||
blockbot_check_login_attempt($_SERVER['REQUEST_URI'], $logdata);
|
blockbot_check_login_attempt($_SERVER['REQUEST_URI'], $logdata);
|
||||||
if (!DI::config()->get('blockbot', 'http_libraries')) {
|
if (!DI::config()->get('blockbot', 'http_libraries')) {
|
||||||
DI::logger()->debug('HTTP Library found - reject', $logdata);
|
Logger::debug('HTTP Library found - reject', $logdata);
|
||||||
blockbot_reject();
|
blockbot_reject();
|
||||||
}
|
}
|
||||||
DI::logger()->debug('HTTP Library found - accept', $logdata);
|
Logger::debug('HTTP Library found - accept', $logdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,12 +161,12 @@ function blockbot_init_1()
|
||||||
|
|
||||||
if (!$isCrawler) {
|
if (!$isCrawler) {
|
||||||
blockbot_save('good-agents', $_SERVER['HTTP_USER_AGENT']);
|
blockbot_save('good-agents', $_SERVER['HTTP_USER_AGENT']);
|
||||||
DI::logger()->debug('Non-bot user agent detected', $logdata);
|
Logger::debug('Non-bot user agent detected', $logdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
blockbot_save('bad-agents', $_SERVER['HTTP_USER_AGENT']);
|
blockbot_save('bad-agents', $_SERVER['HTTP_USER_AGENT']);
|
||||||
DI::logger()->notice('Possible bot found - reject', $logdata);
|
Logger::notice('Possible bot found - reject', $logdata);
|
||||||
blockbot_reject();
|
blockbot_reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +209,7 @@ function blockbot_log_activitypub(string $url, string $agent)
|
||||||
blockbot_save('activitypub-inbox-agents', $agent);
|
blockbot_save('activitypub-inbox-agents', $agent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_SERVER['HTTP_SIGNATURE']) && !empty(HTTPSignature::getSigner('', $_SERVER, false))) {
|
if (!empty($_SERVER['HTTP_SIGNATURE']) && !empty(HTTPSignature::getSigner('', $_SERVER))) {
|
||||||
blockbot_save('activitypub-signature-agents', $agent);
|
blockbot_save('activitypub-signature-agents', $agent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -216,7 +217,7 @@ function blockbot_log_activitypub(string $url, string $agent)
|
||||||
function blockbot_check_login_attempt(string $url, array $logdata)
|
function blockbot_check_login_attempt(string $url, array $logdata)
|
||||||
{
|
{
|
||||||
if (in_array(trim(parse_url($url, PHP_URL_PATH), '/'), ['login', 'lostpass', 'register'])) {
|
if (in_array(trim(parse_url($url, PHP_URL_PATH), '/'), ['login', 'lostpass', 'register'])) {
|
||||||
DI::logger()->debug('Login attempt detected - reject', $logdata);
|
Logger::debug('Login attempt detected - reject', $logdata);
|
||||||
blockbot_reject();
|
blockbot_reject();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -442,7 +443,7 @@ function blockbot_is_monitor(array $parts): bool
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Services in the centralized and decentralized social media environment
|
* Services in the centralized and decentralized social media environment
|
||||||
*
|
*
|
||||||
* @param array $parts
|
* @param array $parts
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
|
1440
bluesky/bluesky.php
1440
bluesky/bluesky.php
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Friendica\DI;
|
use Friendica\Core\Logger;
|
||||||
|
|
||||||
function bluesky_feed_run($argv, $argc)
|
function bluesky_feed_run($argv, $argc)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@ function bluesky_feed_run($argv, $argc)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::logger()->debug('Importing feed - start', ['user' => $argv[1], 'feed' => $argv[2]]);
|
Logger::debug('Importing feed - start', ['user' => $argv[1], 'feed' => $argv[2]]);
|
||||||
bluesky_fetch_feed($argv[1], $argv[2]);
|
bluesky_fetch_feed($argv[1], $argv[2]);
|
||||||
DI::logger()->debug('Importing feed - done', ['user' => $argv[1], 'feed' => $argv[2]]);
|
Logger::debug('Importing feed - done', ['user' => $argv[1], 'feed' => $argv[2]]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Friendica\DI;
|
use Friendica\Core\Logger;
|
||||||
|
|
||||||
function bluesky_notifications_run($argv, $argc)
|
function bluesky_notifications_run($argv, $argc)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@ function bluesky_notifications_run($argv, $argc)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::logger()->notice('importing notifications - start', ['user' => $argv[1]]);
|
Logger::notice('importing notifications - start', ['user' => $argv[1]]);
|
||||||
bluesky_fetch_notifications($argv[1]);
|
bluesky_fetch_notifications($argv[1]);
|
||||||
DI::logger()->notice('importing notifications - done', ['user' => $argv[1]]);
|
Logger::notice('importing notifications - done', ['user' => $argv[1]]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Friendica\DI;
|
use Friendica\Core\Logger;
|
||||||
|
|
||||||
function bluesky_timeline_run($argv, $argc)
|
function bluesky_timeline_run($argv, $argc)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@ function bluesky_timeline_run($argv, $argc)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::logger()->notice('importing timeline - start', ['user' => $argv[1]]);
|
Logger::notice('importing timeline - start', ['user' => $argv[1]]);
|
||||||
bluesky_fetch_timeline($argv[1]);
|
bluesky_fetch_timeline($argv[1]);
|
||||||
DI::logger()->notice('importing timeline - done', ['user' => $argv[1]]);
|
Logger::notice('importing timeline - done', ['user' => $argv[1]]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
* Author: Mike Macgirvin <mike@macgirvin.com>
|
* Author: Mike Macgirvin <mike@macgirvin.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
@ -15,7 +16,7 @@ function calc_install() {
|
||||||
|
|
||||||
function calc_app_menu(array &$b)
|
function calc_app_menu(array &$b)
|
||||||
{
|
{
|
||||||
$b['app_menu'][] = '<div class="app-title"><a href="calc">Calculator</a></div>';
|
$b['app_menu'][] = '<div class="app-title"><a href="calc">Calculator</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -295,7 +296,7 @@ $o .= <<< EOT
|
||||||
<h3>Calculator</h3>
|
<h3>Calculator</h3>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<table>
|
<table>
|
||||||
<tbody><tr><td>
|
<tbody><tr><td>
|
||||||
<table bgcolor="#af9999" border="1">
|
<table bgcolor="#af9999" border="1">
|
||||||
<tbody><tr><td>
|
<tbody><tr><td>
|
||||||
<table border="1" cellpadding="2" cellspacing="2">
|
<table border="1" cellpadding="2" cellspacing="2">
|
||||||
|
@ -322,7 +323,7 @@ $o .= <<< EOT
|
||||||
<td><input name="multiplication" value=" * " onclick="multiplyNumbers()" type="button"></td>
|
<td><input name="multiplication" value=" * " onclick="multiplyNumbers()" type="button"></td>
|
||||||
</tr><tr align="left" valign="middle">
|
</tr><tr align="left" valign="middle">
|
||||||
<td><input name="zero" value=" 0 " onclick="addDisplay(0)" type="button"></td>
|
<td><input name="zero" value=" 0 " onclick="addDisplay(0)" type="button"></td>
|
||||||
<td><input name="pi" value=" Pi " onclick="addDisplay(Math.PI)" type="button"> </td>
|
<td><input name="pi" value=" Pi " onclick="addDisplay(Math.PI)" type="button"> </td>
|
||||||
<td><input name="dot" value=" . " onclick='addDisplay(".")' type="button"></td>
|
<td><input name="dot" value=" . " onclick='addDisplay(".")' type="button"></td>
|
||||||
<td><input name="division" value=" / " onclick="divideNumbers()" type="button"></td>
|
<td><input name="division" value=" / " onclick="divideNumbers()" type="button"></td>
|
||||||
</tr><tr align="left" valign="middle">
|
</tr><tr align="left" valign="middle">
|
||||||
|
@ -344,13 +345,13 @@ $o .= <<< EOT
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<TD VALIGN=top>
|
<TD VALIGN=top>
|
||||||
<B>NOTE:</B> All sine and cosine calculations are
|
<B>NOTE:</B> All sine and cosine calculations are
|
||||||
<br>done in radians. Remember to convert first
|
<br>done in radians. Remember to convert first
|
||||||
<br>if using degrees.
|
<br>if using degrees.
|
||||||
</TD>
|
</TD>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
</td></tr></tbody></table>
|
</td></tr></tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,11 @@
|
||||||
* Author: Fabio <https://kirgroup.com/profile/fabrixxm>
|
* Author: Fabio <https://kirgroup.com/profile/fabrixxm>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
@ -26,7 +29,7 @@ function catavatar_install()
|
||||||
Hook::register('addon_settings', __FILE__, 'catavatar_addon_settings');
|
Hook::register('addon_settings', __FILE__, 'catavatar_addon_settings');
|
||||||
Hook::register('addon_settings_post', __FILE__, 'catavatar_addon_settings_post');
|
Hook::register('addon_settings_post', __FILE__, 'catavatar_addon_settings_post');
|
||||||
|
|
||||||
DI::logger()->notice('registered catavatar');
|
Logger::notice('registered catavatar');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
13
cld/cld.php
13
cld/cld.php
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
function cld_install()
|
function cld_install()
|
||||||
|
@ -17,17 +18,17 @@ function cld_install()
|
||||||
function cld_detect_languages(array &$data)
|
function cld_detect_languages(array &$data)
|
||||||
{
|
{
|
||||||
if (!in_array('cld2', get_loaded_extensions())) {
|
if (!in_array('cld2', get_loaded_extensions())) {
|
||||||
DI::logger()->warning('CLD2 is not installed.');
|
Logger::warning('CLD2 is not installed.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists('CLD2Detector')) {
|
if (!class_exists('CLD2Detector')) {
|
||||||
DI::logger()->warning('CLD2Detector class does not exist.');
|
Logger::warning('CLD2Detector class does not exist.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists('CLD2Encoding')) {
|
if (!class_exists('CLD2Encoding')) {
|
||||||
DI::logger()->warning('CLD2Encoding class does not exist.');
|
Logger::warning('CLD2Encoding class does not exist.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +53,7 @@ function cld_detect_languages(array &$data)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$result['is_reliable']) {
|
if (!$result['is_reliable']) {
|
||||||
DI::logger()->debug('Unreliable detection', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]);
|
Logger::debug('Unreliable detection', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]);
|
||||||
if (($original == $detected) && ($data['detected'][$original] < $result['language_probability'] / 100)) {
|
if (($original == $detected) && ($data['detected'][$original] < $result['language_probability'] / 100)) {
|
||||||
$data['detected'][$original] = $result['language_probability'] / 100;
|
$data['detected'][$original] = $result['language_probability'] / 100;
|
||||||
}
|
}
|
||||||
|
@ -62,12 +63,12 @@ function cld_detect_languages(array &$data)
|
||||||
$available = array_keys(DI::l10n()->getLanguageCodes());
|
$available = array_keys(DI::l10n()->getLanguageCodes());
|
||||||
|
|
||||||
if (!in_array($detected, $available)) {
|
if (!in_array($detected, $available)) {
|
||||||
DI::logger()->debug('Unsupported language', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]);
|
Logger::debug('Unsupported language', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($original != $detected) {
|
if ($original != $detected) {
|
||||||
DI::logger()->debug('Detected different language', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]);
|
Logger::debug('Detected different language', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$length = count($data['detected']);
|
$length = count($data['detected']);
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
* Author: Peter Liebetrau <https://socivitas/profile/peerteer>
|
* Author: Peter Liebetrau <https://socivitas/profile/peerteer>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
|
@ -33,6 +33,7 @@ class Diaspora_Connection {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->cookiejar = tempnam(System::getTempPath(), 'cookies');
|
$this->cookiejar = tempnam(System::getTempPath(), 'cookies');
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __destruct() {
|
public function __destruct() {
|
||||||
|
|
|
@ -9,8 +9,10 @@
|
||||||
|
|
||||||
require_once 'addon/diaspora/Diaspora_Connection.php';
|
require_once 'addon/diaspora/Diaspora_Connection.php';
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
|
@ -185,7 +187,7 @@ function diaspora_send(array &$b)
|
||||||
{
|
{
|
||||||
$hostname = DI::baseUrl()->getHost();
|
$hostname = DI::baseUrl()->getHost();
|
||||||
|
|
||||||
DI::logger()->notice('diaspora_send: invoked');
|
Logger::notice('diaspora_send: invoked');
|
||||||
|
|
||||||
if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) {
|
if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) {
|
||||||
return;
|
return;
|
||||||
|
@ -209,14 +211,14 @@ function diaspora_send(array &$b)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::logger()->info('diaspora_send: prepare posting');
|
Logger::info('diaspora_send: prepare posting');
|
||||||
|
|
||||||
$handle = DI::pConfig()->get($b['uid'], 'diaspora', 'handle');
|
$handle = DI::pConfig()->get($b['uid'], 'diaspora', 'handle');
|
||||||
$password = DI::pConfig()->get($b['uid'], 'diaspora', 'password');
|
$password = DI::pConfig()->get($b['uid'], 'diaspora', 'password');
|
||||||
$aspect = DI::pConfig()->get($b['uid'], 'diaspora', 'aspect');
|
$aspect = DI::pConfig()->get($b['uid'], 'diaspora', 'aspect');
|
||||||
|
|
||||||
if ($handle && $password) {
|
if ($handle && $password) {
|
||||||
DI::logger()->info('diaspora_send: all values seem to be okay');
|
Logger::info('diaspora_send: all values seem to be okay');
|
||||||
|
|
||||||
$title = $b['title'];
|
$title = $b['title'];
|
||||||
$body = $b['body'];
|
$body = $b['body'];
|
||||||
|
@ -247,20 +249,20 @@ function diaspora_send(array &$b)
|
||||||
require_once "addon/diaspora/diasphp.php";
|
require_once "addon/diaspora/diasphp.php";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
DI::logger()->info('diaspora_send: prepare');
|
Logger::info('diaspora_send: prepare');
|
||||||
$conn = new Diaspora_Connection($handle, $password);
|
$conn = new Diaspora_Connection($handle, $password);
|
||||||
DI::logger()->info('diaspora_send: try to log in ' . $handle);
|
Logger::info('diaspora_send: try to log in ' . $handle);
|
||||||
$conn->logIn();
|
$conn->logIn();
|
||||||
DI::logger()->info('diaspora_send: try to send ' . $body);
|
Logger::info('diaspora_send: try to send ' . $body);
|
||||||
|
|
||||||
$conn->provider = $hostname;
|
$conn->provider = $hostname;
|
||||||
$conn->postStatusMessage($body, $aspect);
|
$conn->postStatusMessage($body, $aspect);
|
||||||
|
|
||||||
DI::logger()->notice('diaspora_send: success');
|
Logger::notice('diaspora_send: success');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
DI::logger()->notice("diaspora_send: Error submitting the post: " . $e->getMessage());
|
Logger::notice("diaspora_send: Error submitting the post: " . $e->getMessage());
|
||||||
|
|
||||||
DI::logger()->info('diaspora_send: requeueing ' . $b['uid']);
|
Logger::info('diaspora_send: requeueing ' . $b['uid']);
|
||||||
|
|
||||||
Worker::defer();
|
Worker::defer();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,10 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Content\Text\Markdown;
|
use Friendica\Content\Text\Markdown;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
@ -78,13 +80,13 @@ function discourse_email_getmessage(&$message)
|
||||||
// We do assume that all Discourse servers are running with SSL
|
// We do assume that all Discourse servers are running with SSL
|
||||||
if (preg_match('=topic/(.*\d)/(.*\d)@(.*)=', $message['item']['uri'], $matches) &&
|
if (preg_match('=topic/(.*\d)/(.*\d)@(.*)=', $message['item']['uri'], $matches) &&
|
||||||
discourse_fetch_post_from_api($message, $matches[2], $matches[3])) {
|
discourse_fetch_post_from_api($message, $matches[2], $matches[3])) {
|
||||||
DI::logger()->info('Fetched comment via API (message-id mode)', ['host' => $matches[3], 'topic' => $matches[1], 'post' => $matches[2]]);
|
Logger::info('Fetched comment via API (message-id mode)', ['host' => $matches[3], 'topic' => $matches[1], 'post' => $matches[2]]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('=topic/(.*\d)@(.*)=', $message['item']['uri'], $matches) &&
|
if (preg_match('=topic/(.*\d)@(.*)=', $message['item']['uri'], $matches) &&
|
||||||
discourse_fetch_topic_from_api($message, 'https://' . $matches[2], $matches[1], 1)) {
|
discourse_fetch_topic_from_api($message, 'https://' . $matches[2], $matches[1], 1)) {
|
||||||
DI::logger()->info('Fetched starting post via API (message-id mode)', ['host' => $matches[2], 'topic' => $matches[1]]);
|
Logger::info('Fetched starting post via API (message-id mode)', ['host' => $matches[2], 'topic' => $matches[1]]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,16 +96,16 @@ function discourse_email_getmessage(&$message)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($message['item']['plink']) || !preg_match('=(http.*)/t/.*/(.*\d)/(.*\d)=', $message['item']['plink'], $matches)) {
|
if (empty($message['item']['plink']) || !preg_match('=(http.*)/t/.*/(.*\d)/(.*\d)=', $message['item']['plink'], $matches)) {
|
||||||
DI::logger()->info('This is no Discourse post');
|
Logger::info('This is no Discourse post');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (discourse_fetch_topic_from_api($message, $matches[1], $matches[2], $matches[3])) {
|
if (discourse_fetch_topic_from_api($message, $matches[1], $matches[2], $matches[3])) {
|
||||||
DI::logger()->info('Fetched post via API (plink mode)', ['host' => $matches[1], 'topic' => $matches[2], 'id' => $matches[3]]);
|
Logger::info('Fetched post via API (plink mode)', ['host' => $matches[1], 'topic' => $matches[2], 'id' => $matches[3]]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::logger()->info('Fallback mode', ['plink' => $message['item']['plink']]);
|
Logger::info('Fallback mode', ['plink' => $message['item']['plink']]);
|
||||||
// Search in the HTML part for the discourse entry and the author profile
|
// Search in the HTML part for the discourse entry and the author profile
|
||||||
if (!empty($message['html'])) {
|
if (!empty($message['html'])) {
|
||||||
$message = discourse_get_html($message);
|
$message = discourse_get_html($message);
|
||||||
|
@ -120,7 +122,7 @@ function discourse_fetch_post($host, $topic, $pid)
|
||||||
$url = $host . '/t/' . $topic . '/' . $pid . '.json';
|
$url = $host . '/t/' . $topic . '/' . $pid . '.json';
|
||||||
$curlResult = DI::httpClient()->get($url);
|
$curlResult = DI::httpClient()->get($url);
|
||||||
if (!$curlResult->isSuccess()) {
|
if (!$curlResult->isSuccess()) {
|
||||||
DI::logger()->info('No success', ['url' => $url]);
|
Logger::info('No success', ['url' => $url]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,11 +134,11 @@ function discourse_fetch_post($host, $topic, $pid)
|
||||||
/// @todo Possibly fetch missing posts here
|
/// @todo Possibly fetch missing posts here
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
DI::logger()->info('Got post data from topic', $post);
|
Logger::info('Got post data from topic', $post);
|
||||||
return $post;
|
return $post;
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::logger()->info('Post not found', ['host' => $host, 'topic' => $topic, 'pid' => $pid]);
|
Logger::info('Post not found', ['host' => $host, 'topic' => $topic, 'pid' => $pid]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +170,7 @@ function discourse_fetch_post_from_api(&$message, $post, $host)
|
||||||
|
|
||||||
$message = discourse_process_post($message, $data, $hostaddr);
|
$message = discourse_process_post($message, $data, $hostaddr);
|
||||||
|
|
||||||
DI::logger()->info('Got API data', $message);
|
Logger::info('Got API data', $message);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,7 +203,7 @@ function discourse_get_user($post, $hostaddr)
|
||||||
$contact['url'] = $hostaddr . '/u/' . $contact['nick'];
|
$contact['url'] = $hostaddr . '/u/' . $contact['nick'];
|
||||||
$contact['nurl'] = Strings::normaliseLink($contact['url']);
|
$contact['nurl'] = Strings::normaliseLink($contact['url']);
|
||||||
$contact['baseurl'] = $hostaddr;
|
$contact['baseurl'] = $hostaddr;
|
||||||
DI::logger()->info('Contact', $contact);
|
Logger::info('Contact', $contact);
|
||||||
$contact['id'] = Contact::getIdForURL($contact['url'], 0, false, $contact);
|
$contact['id'] = Contact::getIdForURL($contact['url'], 0, false, $contact);
|
||||||
if (!empty($contact['id'])) {
|
if (!empty($contact['id'])) {
|
||||||
$avatar = $contact['photo'];
|
$avatar = $contact['photo'];
|
||||||
|
@ -267,11 +269,11 @@ function discourse_get_html($message)
|
||||||
$div = $doc2->importNode($result->item(0), true);
|
$div = $doc2->importNode($result->item(0), true);
|
||||||
$doc2->appendChild($div);
|
$doc2->appendChild($div);
|
||||||
$message['html'] = $doc2->saveHTML();
|
$message['html'] = $doc2->saveHTML();
|
||||||
DI::logger()->info('Found html body', ['html' => $message['html']]);
|
Logger::info('Found html body', ['html' => $message['html']]);
|
||||||
|
|
||||||
$profile = discourse_get_profile($xpath);
|
$profile = discourse_get_profile($xpath);
|
||||||
if (!empty($profile['url'])) {
|
if (!empty($profile['url'])) {
|
||||||
DI::logger()->info('Found profile', $profile);
|
Logger::info('Found profile', $profile);
|
||||||
$message['item']['author-id'] = Contact::getIdForURL($profile['url'], 0, false, $profile);
|
$message['item']['author-id'] = Contact::getIdForURL($profile['url'], 0, false, $profile);
|
||||||
$message['item']['author-link'] = $profile['url'];
|
$message['item']['author-link'] = $profile['url'];
|
||||||
$message['item']['author-name'] = $profile['name'];
|
$message['item']['author-name'] = $profile['name'];
|
||||||
|
@ -287,21 +289,21 @@ function discourse_get_text($message)
|
||||||
$text = str_replace("\r", '', $text);
|
$text = str_replace("\r", '', $text);
|
||||||
$pos = strpos($text, "\n---\n");
|
$pos = strpos($text, "\n---\n");
|
||||||
if ($pos == 0) {
|
if ($pos == 0) {
|
||||||
DI::logger()->info('No separator found', ['text' => $text]);
|
Logger::info('No separator found', ['text' => $text]);
|
||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
$message['text'] = trim(substr($text, 0, $pos));
|
$message['text'] = trim(substr($text, 0, $pos));
|
||||||
|
|
||||||
DI::logger()->info('Found text body', ['text' => $message['text']]);
|
Logger::info('Found text body', ['text' => $message['text']]);
|
||||||
|
|
||||||
$message['text'] = Markdown::toBBCode($message['text']);
|
$message['text'] = Markdown::toBBCode($message['text']);
|
||||||
|
|
||||||
$text = substr($text, $pos);
|
$text = substr($text, $pos);
|
||||||
DI::logger()->info('Found footer', ['text' => $text]);
|
Logger::info('Found footer', ['text' => $text]);
|
||||||
if (preg_match('=\((http.*/t/.*/.*\d/.*\d)\)=', $text, $link)) {
|
if (preg_match('=\((http.*/t/.*/.*\d/.*\d)\)=', $text, $link)) {
|
||||||
$message['item']['plink'] = $link[1];
|
$message['item']['plink'] = $link[1];
|
||||||
DI::logger()->info('Found plink', ['plink' => $message['item']['plink']]);
|
Logger::info('Found plink', ['plink' => $message['item']['plink']]);
|
||||||
}
|
}
|
||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,10 @@
|
||||||
* Author: Cat Gray <https://free-haven.org/profile/catness>
|
* Author: Cat Gray <https://free-haven.org/profile/catness>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
@ -184,12 +186,12 @@ function dwpost_send(array &$b)
|
||||||
|
|
||||||
EOT;
|
EOT;
|
||||||
|
|
||||||
DI::logger()->debug('dwpost: data: ' . $xml);
|
Logger::debug('dwpost: data: ' . $xml);
|
||||||
|
|
||||||
if ($dw_blog !== 'test') {
|
if ($dw_blog !== 'test') {
|
||||||
$x = DI::httpClient()->post($dw_blog, $xml, ['Content-Type' => 'text/xml'])->getBodyString();
|
$x = DI::httpClient()->post($dw_blog, $xml, ['Content-Type' => 'text/xml'])->getBodyString();
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::logger()->info('posted to dreamwidth: ' . ($x) ? $x : '');
|
Logger::info('posted to dreamwidth: ' . ($x) ? $x : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
* Status: Unsupported
|
* Status: Unsupported
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
@ -39,7 +40,7 @@ function fancybox_render(array &$b){
|
||||||
function ($text) use ($gallery) {
|
function ($text) use ($gallery) {
|
||||||
// This processes images inlined in posts
|
// This processes images inlined in posts
|
||||||
// Frio / Vier hooks für lightbox are un-hooked in fancybox-config.js. So this works for them, too!
|
// Frio / Vier hooks für lightbox are un-hooked in fancybox-config.js. So this works for them, too!
|
||||||
//if (!in_array(DI::appHelper()->getCurrentTheme(),['vier','frio']))
|
//if (!in_array(DI::app()->getCurrentTheme(),['vier','frio']))
|
||||||
$text = preg_replace(
|
$text = preg_replace(
|
||||||
'#<a[^>]*href="([^"]*)"[^>]*>(<img[^>]*src="[^"]*"[^>]*>)</a>#',
|
'#<a[^>]*href="([^"]*)"[^>]*>(<img[^>]*src="[^"]*"[^>]*>)</a>#',
|
||||||
'<a data-fancybox="' . $gallery . '" href="$1">$2</a>',
|
'<a data-fancybox="' . $gallery . '" href="$1">$2</a>',
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
@ -16,7 +18,7 @@ function fromapp_install()
|
||||||
Hook::register('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
|
Hook::register('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
|
||||||
Hook::register('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
|
Hook::register('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
|
||||||
Hook::register('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
|
Hook::register('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
|
||||||
DI::logger()->notice("installed fromapp");
|
Logger::notice("installed fromapp");
|
||||||
}
|
}
|
||||||
|
|
||||||
function fromapp_settings_post($post)
|
function fromapp_settings_post($post)
|
||||||
|
@ -74,6 +76,6 @@ function fromapp_post_hook(&$item)
|
||||||
|
|
||||||
$apps = explode(',', $app);
|
$apps = explode(',', $app);
|
||||||
$item['app'] = trim($apps[mt_rand(0, count($apps)-1)]);
|
$item['app'] = trim($apps[mt_rand(0, count($apps)-1)]);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
@ -50,25 +52,25 @@ function geocoordinates_resolve_item(array &$item)
|
||||||
$s = DI::httpClient()->fetch('https://api.opencagedata.com/geocode/v1/json?q=' . $coords[0] . ',' . $coords[1] . '&key=' . $key . '&language=' . $language);
|
$s = DI::httpClient()->fetch('https://api.opencagedata.com/geocode/v1/json?q=' . $coords[0] . ',' . $coords[1] . '&key=' . $key . '&language=' . $language);
|
||||||
|
|
||||||
if (!$s) {
|
if (!$s) {
|
||||||
DI::logger()->info('API could not be queried');
|
Logger::info('API could not be queried');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = json_decode($s);
|
$data = json_decode($s);
|
||||||
|
|
||||||
if ($data->status->code != '200') {
|
if ($data->status->code != '200') {
|
||||||
DI::logger()->info('API returned error ' . $data->status->code . ' ' . $data->status->message);
|
Logger::info('API returned error ' . $data->status->code . ' ' . $data->status->message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($data->total_results == 0) || (count($data->results) == 0)) {
|
if (($data->total_results == 0) || (count($data->results) == 0)) {
|
||||||
DI::logger()->info('No results found for coordinates ' . $item['coord']);
|
Logger::info('No results found for coordinates ' . $item['coord']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$item['location'] = $data->results[0]->formatted;
|
$item['location'] = $data->results[0]->formatted;
|
||||||
|
|
||||||
DI::logger()->info('Got location for coordinates ' . $coords[0] . '-' . $coords[1] . ': ' . $item['location']);
|
Logger::info('Got location for coordinates ' . $coords[0] . '-' . $coords[1] . ': ' . $item['location']);
|
||||||
|
|
||||||
if ($item['location'] != '') {
|
if ($item['location'] != '') {
|
||||||
DI::cache()->set('geocoordinates:' . $language.':' . $coords[0] . '-' . $coords[1], $item['location']);
|
DI::cache()->set('geocoordinates:' . $language.':' . $coords[0] . '-' . $coords[1], $item['location']);
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Core\Config\Util\ConfigFileManager;
|
use Friendica\Core\Config\Util\ConfigFileManager;
|
||||||
|
@ -33,7 +35,7 @@ function geonames_install()
|
||||||
|
|
||||||
function geonames_load_config(ConfigFileManager $loader)
|
function geonames_load_config(ConfigFileManager $loader)
|
||||||
{
|
{
|
||||||
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('geonames'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
DI::app()->getConfigCache()->load($loader->loadAddonConfig('geonames'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
function geonames_post_hook(array &$item)
|
function geonames_post_hook(array &$item)
|
||||||
|
@ -44,7 +46,7 @@ function geonames_post_hook(array &$item)
|
||||||
* - The profile owner must have allowed our addon
|
* - The profile owner must have allowed our addon
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DI::logger()->notice('geonames invoked');
|
Logger::notice('geonames invoked');
|
||||||
|
|
||||||
if (!DI::userSession()->getLocalUserId()) { /* non-zero if this is a logged in user of this system */
|
if (!DI::userSession()->getLocalUserId()) { /* non-zero if this is a logged in user of this system */
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -4,11 +4,13 @@
|
||||||
* Description: Thread email comment notifications on Gmail and anonymise them
|
* Description: Thread email comment notifications on Gmail and anonymise them
|
||||||
* Version: 1.0
|
* Version: 1.0
|
||||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Notification;
|
use Friendica\Model\Notification;
|
||||||
|
@ -19,7 +21,7 @@ function gnot_install()
|
||||||
Hook::register('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
|
Hook::register('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
|
||||||
Hook::register('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
|
Hook::register('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
|
||||||
|
|
||||||
DI::logger()->notice("installed gnot");
|
Logger::notice("installed gnot");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,7 +38,7 @@ function gnot_settings_post($post) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called from the Addon Setting form.
|
* Called from the Addon Setting form.
|
||||||
* Add our own settings info to the page.
|
* Add our own settings info to the page.
|
||||||
*/
|
*/
|
||||||
function gnot_settings(array &$data)
|
function gnot_settings(array &$data)
|
||||||
|
|
|
@ -7,14 +7,15 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\DI;
|
use Friendica\Core\Logger;
|
||||||
|
|
||||||
function googlemaps_install()
|
function googlemaps_install()
|
||||||
{
|
{
|
||||||
Hook::register('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
|
Hook::register('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
|
||||||
|
|
||||||
DI::logger()->notice('installed googlemaps');
|
Logger::notice('installed googlemaps');
|
||||||
}
|
}
|
||||||
|
|
||||||
function googlemaps_location(&$item)
|
function googlemaps_location(&$item)
|
||||||
|
|
|
@ -6,11 +6,15 @@
|
||||||
* Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus>
|
* Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Core\Config\Util\ConfigFileManager;
|
use Friendica\Core\Config\Util\ConfigFileManager;
|
||||||
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Installs the addon hook
|
* Installs the addon hook
|
||||||
|
@ -19,12 +23,12 @@ function gravatar_install() {
|
||||||
Hook::register('load_config', 'addon/gravatar/gravatar.php', 'gravatar_load_config');
|
Hook::register('load_config', 'addon/gravatar/gravatar.php', 'gravatar_load_config');
|
||||||
Hook::register('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup');
|
Hook::register('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup');
|
||||||
|
|
||||||
DI::logger()->notice("registered gravatar in avatar_lookup hook");
|
Logger::notice("registered gravatar in avatar_lookup hook");
|
||||||
}
|
}
|
||||||
|
|
||||||
function gravatar_load_config(ConfigFileManager $loader)
|
function gravatar_load_config(ConfigFileManager $loader)
|
||||||
{
|
{
|
||||||
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('gravatar'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
DI::app()->getConfigCache()->load($loader->loadAddonConfig('gravatar'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
* Note: Please use Circle Text instead
|
* Note: Please use Circle Text instead
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
* Author: Hypolite Petovan <hypolite@mrpetovan.com>
|
* Author: Hypolite Petovan <hypolite@mrpetovan.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
@ -17,7 +18,7 @@ function highlightjs_install()
|
||||||
|
|
||||||
function highlightjs_head(string &$str)
|
function highlightjs_head(string &$str)
|
||||||
{
|
{
|
||||||
if (DI::appHelper()->getCurrentTheme() == 'frio') {
|
if (DI::app()->getCurrentTheme() == 'frio') {
|
||||||
$style = 'bootstrap';
|
$style = 'bootstrap';
|
||||||
} else {
|
} else {
|
||||||
$style = 'default';
|
$style = 'default';
|
||||||
|
|
|
@ -6,8 +6,10 @@
|
||||||
* Version: 0.1
|
* Version: 0.1
|
||||||
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
||||||
*/
|
*/
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Content\PageInfo;
|
use Friendica\Content\PageInfo;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
@ -85,16 +87,16 @@ function ifttt_post()
|
||||||
|
|
||||||
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname]);
|
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname]);
|
||||||
if (!DBA::isResult($user)) {
|
if (!DBA::isResult($user)) {
|
||||||
DI::logger()->info('User ' . $nickname . ' not found.');
|
Logger::info('User ' . $nickname . ' not found.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$uid = $user['uid'];
|
$uid = $user['uid'];
|
||||||
|
|
||||||
DI::logger()->info('Received a post for user ' . $uid . ' from ifttt ' . print_r($_REQUEST, true));
|
Logger::info('Received a post for user ' . $uid . ' from ifttt ' . print_r($_REQUEST, true));
|
||||||
|
|
||||||
if (!isset($_REQUEST['key'])) {
|
if (!isset($_REQUEST['key'])) {
|
||||||
DI::logger()->notice('No key found.');
|
Logger::notice('No key found.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +104,7 @@ function ifttt_post()
|
||||||
|
|
||||||
// Check the key
|
// Check the key
|
||||||
if ($key != DI::pConfig()->get($uid, 'ifttt', 'key')) {
|
if ($key != DI::pConfig()->get($uid, 'ifttt', 'key')) {
|
||||||
DI::logger()->info('Invalid key for user ' . $uid);
|
Logger::info('Invalid key for user ' . $uid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +115,7 @@ function ifttt_post()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($item['type'], ['status', 'link', 'photo'])) {
|
if (!in_array($item['type'], ['status', 'link', 'photo'])) {
|
||||||
DI::logger()->info('Unknown item type ' . $item['type']);
|
Logger::info('Unknown item type ' . $item['type']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,10 @@
|
||||||
* Author: Cat Gray <https://free-haven.org/profile/catness>
|
* Author: Cat Gray <https://free-haven.org/profile/catness>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
@ -177,11 +179,11 @@ function ijpost_send(array &$b)
|
||||||
|
|
||||||
EOT;
|
EOT;
|
||||||
|
|
||||||
DI::logger()->debug('ijpost: data: ' . $xml);
|
Logger::debug('ijpost: data: ' . $xml);
|
||||||
|
|
||||||
if ($ij_blog !== 'test') {
|
if ($ij_blog !== 'test') {
|
||||||
$x = DI::httpClient()->post($ij_blog, $xml, ['Content-Type' => 'text/xml'])->getBodyString();
|
$x = DI::httpClient()->post($ij_blog, $xml, ['Content-Type' => 'text/xml'])->getBodyString();
|
||||||
}
|
}
|
||||||
DI::logger()->info('posted to insanejournal: ' . $x ? $x : '');
|
Logger::info('posted to insanejournal: ' . $x ? $x : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,10 @@
|
||||||
* License: 3-clause BSD license
|
* License: 3-clause BSD license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Core\Config\Util\ConfigFileManager;
|
use Friendica\Core\Config\Util\ConfigFileManager;
|
||||||
|
@ -19,7 +21,7 @@ function impressum_install()
|
||||||
Hook::register('load_config', 'addon/impressum/impressum.php', 'impressum_load_config');
|
Hook::register('load_config', 'addon/impressum/impressum.php', 'impressum_load_config');
|
||||||
Hook::register('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
|
Hook::register('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
|
||||||
Hook::register('page_end', 'addon/impressum/impressum.php', 'impressum_footer');
|
Hook::register('page_end', 'addon/impressum/impressum.php', 'impressum_footer');
|
||||||
DI::logger()->notice("installed impressum Addon");
|
Logger::notice("installed impressum Addon");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,7 +56,7 @@ function impressum_footer(string &$body)
|
||||||
|
|
||||||
function impressum_load_config(ConfigFileManager $loader)
|
function impressum_load_config(ConfigFileManager $loader)
|
||||||
{
|
{
|
||||||
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('impressum'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
DI::app()->getConfigCache()->load($loader->loadAddonConfig('impressum'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
function impressum_show(string &$body)
|
function impressum_show(string &$body)
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
|
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,8 @@ function invidious_settings(array &$data)
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/invidious/');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/invidious/');
|
||||||
$html = Renderer::replaceMacros($t, [
|
$html = Renderer::replaceMacros($t, [
|
||||||
'$enabled' => ['invidious-enabled', DI::l10n()->t('Replace Youtube links with links to an Invidious server'), $enabled, DI::l10n()->t('If enabled, Youtube links are replaced with the links to the specified Invidious server.')],
|
'$enabled' => ['enabled', DI::l10n()->t('Replace Youtube links with links to an Invidious server'), $enabled, DI::l10n()->t('If enabled, Youtube links are replaced with the links to the specified Invidious server.')],
|
||||||
'$server' => ['invidious-server', DI::l10n()->t('Invidious server'), $server, DI::l10n()->t('See %s for a list of available Invidious servers.', '<a href="https://api.invidious.io/">https://api.invidious.io/</a>')],
|
'$server' => ['server', DI::l10n()->t('Invidious server'), $server, DI::l10n()->t('See %s for a list of available Invidious servers.', '<a href="https://api.invidious.io/">https://api.invidious.io/</a>')],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
|
@ -71,9 +71,9 @@ function invidious_settings_post(array &$b)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'invidious', 'enabled', (bool)$_POST['invidious-enabled']);
|
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'invidious', 'enabled', (bool)$_POST['enabled']);
|
||||||
|
|
||||||
$server = trim($_POST['invidious-server'], " \n\r\t\v\x00/");
|
$server = trim($_POST['server'], " \n\r\t\v\x00/");
|
||||||
if ($server != DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT) && !empty($server)) {
|
if ($server != DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT) && !empty($server)) {
|
||||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'invidious', 'server', $server);
|
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'invidious', 'server', $server);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
* Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias>
|
* Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Util\Images;
|
use Friendica\Util\Images;
|
||||||
|
@ -67,7 +68,7 @@ function js_upload_post_init(array &$b)
|
||||||
$js_upload_jsonresponse = htmlspecialchars(json_encode($result), ENT_NOQUOTES);
|
$js_upload_jsonresponse = htmlspecialchars(json_encode($result), ENT_NOQUOTES);
|
||||||
|
|
||||||
if (isset($result['error'])) {
|
if (isset($result['error'])) {
|
||||||
DI::logger()->info('mod/photos.php: photos_post(): error uploading photo: ' . $result['error']);
|
Logger::info('mod/photos.php: photos_post(): error uploading photo: ' . $result['error']);
|
||||||
echo json_encode($result);
|
echo json_encode($result);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -90,7 +91,7 @@ function js_upload_post_end(int &$b)
|
||||||
{
|
{
|
||||||
global $js_upload_jsonresponse;
|
global $js_upload_jsonresponse;
|
||||||
|
|
||||||
DI::logger()->notice('upload_post_end');
|
Logger::notice('upload_post_end');
|
||||||
if (!empty($js_upload_jsonresponse)) {
|
if (!empty($js_upload_jsonresponse)) {
|
||||||
echo $js_upload_jsonresponse;
|
echo $js_upload_jsonresponse;
|
||||||
exit();
|
exit();
|
||||||
|
@ -186,10 +187,6 @@ class js_upload_qqFileUploader
|
||||||
{
|
{
|
||||||
private $allowedExtensions;
|
private $allowedExtensions;
|
||||||
private $sizeLimit;
|
private $sizeLimit;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var js_upload_qqUploadedFileXhr|js_upload_qqUploadedFileForm|false
|
|
||||||
*/
|
|
||||||
private $file;
|
private $file;
|
||||||
|
|
||||||
function __construct(array $allowedExtensions = [], $sizeLimit)
|
function __construct(array $allowedExtensions = [], $sizeLimit)
|
||||||
|
@ -237,7 +234,7 @@ class js_upload_qqFileUploader
|
||||||
$filename = $pathinfo['filename'];
|
$filename = $pathinfo['filename'];
|
||||||
|
|
||||||
if (!isset($pathinfo['extension'])) {
|
if (!isset($pathinfo['extension'])) {
|
||||||
DI::logger()->warning('extension isn\'t set.', ['filename' => $filename]);
|
Logger::warning('extension isn\'t set.', ['filename' => $filename]);
|
||||||
}
|
}
|
||||||
$ext = $pathinfo['extension'] ?? '';
|
$ext = $pathinfo['extension'] ?? '';
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -36,7 +37,7 @@ function keycloakpassword_request($client_id, $secret, $url, $params = [])
|
||||||
$res = curl_exec($ch);
|
$res = curl_exec($ch);
|
||||||
|
|
||||||
if (curl_errno($ch)) {
|
if (curl_errno($ch)) {
|
||||||
DI::logger()->error(curl_error($ch));
|
Logger::error(curl_error($ch));
|
||||||
}
|
}
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
*"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere
|
*"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
@ -30,7 +32,7 @@ function krynn_install()
|
||||||
Hook::register('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings');
|
Hook::register('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings');
|
||||||
Hook::register('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
|
Hook::register('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
|
||||||
|
|
||||||
DI::logger()->notice("installed krynn");
|
Logger::notice("installed krynn");
|
||||||
}
|
}
|
||||||
|
|
||||||
function krynn_post_hook(&$item)
|
function krynn_post_hook(&$item)
|
||||||
|
|
|
@ -99,8 +99,8 @@ function langfilter_addon_settings_post(array &$b)
|
||||||
|
|
||||||
function langfilter_prepare_body_content_filter(&$hook_data)
|
function langfilter_prepare_body_content_filter(&$hook_data)
|
||||||
{
|
{
|
||||||
$uid = $hook_data['uid'] ?? DI::userSession()->getLocalUserId();
|
$logged_user = DI::userSession()->getLocalUserId();
|
||||||
if (!$uid) {
|
if (!$logged_user) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,8 +112,8 @@ function langfilter_prepare_body_content_filter(&$hook_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't filter if language filter is disabled
|
// Don't filter if language filter is disabled
|
||||||
if (!DI::pConfig()->get($uid, 'langfilter', 'enable',
|
if (!DI::pConfig()->get($logged_user, 'langfilter', 'enable',
|
||||||
!DI::pConfig()->get($uid, 'langfilter', 'disable'))
|
!DI::pConfig()->get($logged_user, 'langfilter', 'disable'))
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ function langfilter_prepare_body_content_filter(&$hook_data)
|
||||||
$naked_body = preg_replace('#\s+#', ' ', trim($naked_body));
|
$naked_body = preg_replace('#\s+#', ' ', trim($naked_body));
|
||||||
|
|
||||||
// Don't filter if body lenght is below minimum
|
// Don't filter if body lenght is below minimum
|
||||||
$minlen = DI::pConfig()->get($uid, 'langfilter', 'minlength', 32);
|
$minlen = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'langfilter', 'minlength', 32);
|
||||||
if (!$minlen) {
|
if (!$minlen) {
|
||||||
$minlen = 32;
|
$minlen = 32;
|
||||||
}
|
}
|
||||||
|
@ -136,8 +136,8 @@ function langfilter_prepare_body_content_filter(&$hook_data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$read_languages_string = DI::pConfig()->get($uid, 'langfilter', 'languages');
|
$read_languages_string = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'langfilter', 'languages');
|
||||||
$minconfidence = DI::pConfig()->get($uid, 'langfilter', 'minconfidence');
|
$minconfidence = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'langfilter', 'minconfidence');
|
||||||
|
|
||||||
// Don't filter if no spoken languages are configured
|
// Don't filter if no spoken languages are configured
|
||||||
if (!$read_languages_string) {
|
if (!$read_languages_string) {
|
||||||
|
|
|
@ -29,7 +29,9 @@
|
||||||
* The configuration options for this module are described in the config/ldapauth.config.php file
|
* The configuration options for this module are described in the config/ldapauth.config.php file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
|
@ -43,7 +45,7 @@ function ldapauth_install()
|
||||||
|
|
||||||
function ldapauth_load_config(ConfigFileManager $loader)
|
function ldapauth_load_config(ConfigFileManager $loader)
|
||||||
{
|
{
|
||||||
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('ldapauth'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
DI::app()->getConfigCache()->load($loader->loadAddonConfig('ldapauth'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ldapauth_hook_authenticate(array &$b)
|
function ldapauth_hook_authenticate(array &$b)
|
||||||
|
@ -68,54 +70,54 @@ function ldapauth_authenticate($username, $password)
|
||||||
$ldap_autocreateaccount_nameattribute = DI::config()->get('ldapauth', 'ldap_autocreateaccount_nameattribute');
|
$ldap_autocreateaccount_nameattribute = DI::config()->get('ldapauth', 'ldap_autocreateaccount_nameattribute');
|
||||||
|
|
||||||
if (!extension_loaded('ldap') || !strlen($ldap_server)) {
|
if (!extension_loaded('ldap') || !strlen($ldap_server)) {
|
||||||
DI::logger()->error('Addon not configured or missing php-ldap extension', ['extension_loaded' => extension_loaded('ldap'), 'server' => $ldap_server]);
|
Logger::error('Addon not configured or missing php-ldap extension', ['extension_loaded' => extension_loaded('ldap'), 'server' => $ldap_server]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strlen($password)) {
|
if (!strlen($password)) {
|
||||||
DI::logger()->error('Empty password disallowed', ['provided_password_length' => strlen($password)]);
|
Logger::error('Empty password disallowed', ['provided_password_length' => strlen($password)]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$connect = @ldap_connect($ldap_server);
|
$connect = @ldap_connect($ldap_server);
|
||||||
if ($connect === false) {
|
if ($connect === false) {
|
||||||
DI::logger()->warning('Could not connect to LDAP server', ['server' => $ldap_server]);
|
Logger::warning('Could not connect to LDAP server', ['server' => $ldap_server]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
|
@ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||||
@ldap_set_option($connect, LDAP_OPT_REFERRALS, 0);
|
@ldap_set_option($connect, LDAP_OPT_REFERRALS, 0);
|
||||||
if ((@ldap_bind($connect, $ldap_binddn, $ldap_bindpw)) === false) {
|
if ((@ldap_bind($connect, $ldap_binddn, $ldap_bindpw)) === false) {
|
||||||
DI::logger()->warning('Could not bind to LDAP server', ['server' => $ldap_server, 'binddn' => $ldap_binddn, 'errno' => ldap_errno($connect), 'error' => ldap_error($connect)]);
|
Logger::warning('Could not bind to LDAP server', ['server' => $ldap_server, 'binddn' => $ldap_binddn, 'errno' => ldap_errno($connect), 'error' => ldap_error($connect)]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = @ldap_search($connect, $ldap_searchdn, $ldap_userattr . '=' . $username);
|
$res = @ldap_search($connect, $ldap_searchdn, $ldap_userattr . '=' . $username);
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
DI::logger()->notice('LDAP user not found.', ['searchdn' => $ldap_searchdn, 'userattr' => $ldap_userattr, 'username' => $username, 'errno' => ldap_errno($connect), 'error' => ldap_error($connect)]);
|
Logger::notice('LDAP user not found.', ['searchdn' => $ldap_searchdn, 'userattr' => $ldap_userattr, 'username' => $username, 'errno' => ldap_errno($connect), 'error' => ldap_error($connect)]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = @ldap_first_entry($connect, $res);
|
$id = @ldap_first_entry($connect, $res);
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
DI::logger()->notice('Could not retrieve first LDAP entry.', ['searchdn' => $ldap_searchdn, 'userattr' => $ldap_userattr, 'username' => $username, 'errno' => ldap_errno($connect), 'error' => ldap_error($connect)]);
|
Logger::notice('Could not retrieve first LDAP entry.', ['searchdn' => $ldap_searchdn, 'userattr' => $ldap_userattr, 'username' => $username, 'errno' => ldap_errno($connect), 'error' => ldap_error($connect)]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dn = @ldap_get_dn($connect, $id);
|
$dn = @ldap_get_dn($connect, $id);
|
||||||
if (!@ldap_bind($connect, $dn, $password)) {
|
if (!@ldap_bind($connect, $dn, $password)) {
|
||||||
DI::logger()->notice('Could not authenticate LDAP user with provided password', ['errno' => ldap_errno($connect), 'error' => ldap_error($connect)]);
|
Logger::notice('Could not authenticate LDAP user with provided password', ['errno' => ldap_errno($connect), 'error' => ldap_error($connect)]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($ldap_group) && @ldap_compare($connect, $ldap_group, 'member', $dn) !== true) {
|
if (strlen($ldap_group) && @ldap_compare($connect, $ldap_group, 'member', $dn) !== true) {
|
||||||
$errno = @ldap_errno($connect);
|
$errno = @ldap_errno($connect);
|
||||||
if ($errno === 32) {
|
if ($errno === 32) {
|
||||||
DI::logger()->notice('LDAP Access Control Group does not exist', ['errno' => $errno, 'error' => ldap_error($connect)]);
|
Logger::notice('LDAP Access Control Group does not exist', ['errno' => $errno, 'error' => ldap_error($connect)]);
|
||||||
} elseif ($errno === 16) {
|
} elseif ($errno === 16) {
|
||||||
DI::logger()->notice('LDAP membership attribute does not exist in access control group', ['errno' => $errno, 'error' => ldap_error($connect)]);
|
Logger::notice('LDAP membership attribute does not exist in access control group', ['errno' => $errno, 'error' => ldap_error($connect)]);
|
||||||
} else {
|
} else {
|
||||||
DI::logger()->notice('LDAP user isn\'t part of the authorized group', ['dn' => $dn]);
|
Logger::notice('LDAP user isn\'t part of the authorized group', ['dn' => $dn]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ldap_close($connect);
|
@ldap_close($connect);
|
||||||
|
@ -139,7 +141,7 @@ function ldapauth_authenticate($username, $password)
|
||||||
$authentication = User::getAuthenticationInfo($username);
|
$authentication = User::getAuthenticationInfo($username);
|
||||||
return User::getById($authentication['uid']);
|
return User::getById($authentication['uid']);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
DI::logger()->notice('LDAP authentication error: ' . $e->getMessage());
|
Logger::notice('LDAP authentication error: ' . $e->getMessage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,7 +149,7 @@ function ldapauth_authenticate($username, $password)
|
||||||
function ldap_createaccount($username, $password, $email, $name)
|
function ldap_createaccount($username, $password, $email, $name)
|
||||||
{
|
{
|
||||||
if (!strlen($email) || !strlen($name)) {
|
if (!strlen($email) || !strlen($name)) {
|
||||||
DI::logger()->notice('Could not create local user from LDAP data, no email or nickname provided');
|
Logger::notice('Could not create local user from LDAP data, no email or nickname provided');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,10 +161,10 @@ function ldap_createaccount($username, $password, $email, $name)
|
||||||
'password' => $password,
|
'password' => $password,
|
||||||
'verified' => 1
|
'verified' => 1
|
||||||
]);
|
]);
|
||||||
DI::logger()->info('Local user created from LDAP data', ['username' => $username, 'name' => $name]);
|
Logger::info('Local user created from LDAP data', ['username' => $username, 'name' => $name]);
|
||||||
return $user;
|
return $user;
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
DI::logger()->error('Could not create local user from LDAP data', ['username' => $username, 'exception' => $ex->getMessage()]);
|
Logger::error('Could not create local user from LDAP data', ['username' => $username, 'exception' => $ex->getMessage()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
function leistungsschutzrecht_install()
|
function leistungsschutzrecht_install()
|
||||||
|
@ -167,7 +168,7 @@ function leistungsschutzrecht_cron($b)
|
||||||
if ($last) {
|
if ($last) {
|
||||||
$next = $last + 86400;
|
$next = $last + 86400;
|
||||||
if ($next > time()) {
|
if ($next > time()) {
|
||||||
DI::logger()->notice('poll intervall not reached');
|
Logger::notice('poll intervall not reached');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,10 @@
|
||||||
* Author: Tony Baldwin <https://free-haven.org/u/tony>
|
* Author: Tony Baldwin <https://free-haven.org/u/tony>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -129,7 +131,7 @@ function libertree_post_local(array &$b)
|
||||||
|
|
||||||
function libertree_send(array &$b)
|
function libertree_send(array &$b)
|
||||||
{
|
{
|
||||||
DI::logger()->notice('libertree_send: invoked');
|
Logger::notice('libertree_send: invoked');
|
||||||
|
|
||||||
if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) {
|
if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) {
|
||||||
return;
|
return;
|
||||||
|
@ -195,6 +197,6 @@ function libertree_send(array &$b)
|
||||||
];
|
];
|
||||||
|
|
||||||
$result = DI::httpClient()->post($ltree_blog, $params)->getBodyString();
|
$result = DI::httpClient()->post($ltree_blog, $params)->getBodyString();
|
||||||
DI::logger()->notice('libertree: ' . $result);
|
Logger::notice('libertree: ' . $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -361,7 +361,7 @@ class Services_Libravatar
|
||||||
protected function domainGet($identifier)
|
protected function domainGet($identifier)
|
||||||
{
|
{
|
||||||
if ($identifier === null) {
|
if ($identifier === null) {
|
||||||
return '';
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// What are we, email or openid? Split ourself up and get the
|
// What are we, email or openid? Split ourself up and get the
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
* Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus>
|
* Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Core\Config\Util\ConfigFileManager;
|
use Friendica\Core\Config\Util\ConfigFileManager;
|
||||||
|
@ -18,12 +21,12 @@ function libravatar_install()
|
||||||
{
|
{
|
||||||
Hook::register('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config');
|
Hook::register('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config');
|
||||||
Hook::register('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup');
|
Hook::register('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup');
|
||||||
DI::logger()->notice("registered libravatar in avatar_lookup hook");
|
Logger::notice("registered libravatar in avatar_lookup hook");
|
||||||
}
|
}
|
||||||
|
|
||||||
function libravatar_load_config(ConfigFileManager $loader)
|
function libravatar_load_config(ConfigFileManager $loader)
|
||||||
{
|
{
|
||||||
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('libravatar'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
DI::app()->getConfigCache()->load($loader->loadAddonConfig('libravatar'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,9 +73,7 @@ function libravatar_addon_admin(string &$o)
|
||||||
'pagan' => DI::l10n()->t('retro adventure game character'),
|
'pagan' => DI::l10n()->t('retro adventure game character'),
|
||||||
];
|
];
|
||||||
|
|
||||||
$addonHelper = DI::addonHelper();
|
if (Addon::isEnabled('gravatar')) {
|
||||||
|
|
||||||
if ($addonHelper->isAddonEnabled('gravatar')) {
|
|
||||||
$o = '<h5>' .DI::l10n()->t('Information') .'</h5><p>' .DI::l10n()->t('Gravatar addon is installed. Please disable the Gravatar addon.<br>The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar.') .'</p><br><br>';
|
$o = '<h5>' .DI::l10n()->t('Information') .'</h5><p>' .DI::l10n()->t('Gravatar addon is installed. Please disable the Gravatar addon.<br>The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar.') .'</p><br><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
@ -199,7 +200,7 @@ function ljpost_send(array &$b)
|
||||||
</methodCall>
|
</methodCall>
|
||||||
EOT;
|
EOT;
|
||||||
|
|
||||||
DI::logger()->debug('ljpost: data: ' . $xml);
|
Logger::debug('ljpost: data: ' . $xml);
|
||||||
|
|
||||||
$x = '';
|
$x = '';
|
||||||
|
|
||||||
|
@ -207,6 +208,6 @@ EOT;
|
||||||
$x = DI::httpClient()->post($lj_blog, $xml, ['Content-Type' => 'text/xml'])->getBodyString();
|
$x = DI::httpClient()->post($lj_blog, $xml, ['Content-Type' => 'text/xml'])->getBodyString();
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::logger()->info('posted to livejournal: ' . $x);
|
Logger::info('posted to livejournal: ' . $x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
|
@ -31,7 +32,7 @@ function mailstream_install()
|
||||||
Hook::register('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
|
Hook::register('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
|
||||||
Hook::register('mailstream_send_hook', 'addon/mailstream/mailstream.php', 'mailstream_send_hook');
|
Hook::register('mailstream_send_hook', 'addon/mailstream/mailstream.php', 'mailstream_send_hook');
|
||||||
|
|
||||||
DI::logger()->info("installed mailstream");
|
Logger::info("installed mailstream");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -85,7 +86,7 @@ function mailstream_generate_id(string $uri): string
|
||||||
$host = DI::baseUrl()->getHost();
|
$host = DI::baseUrl()->getHost();
|
||||||
$resource = hash('md5', $uri);
|
$resource = hash('md5', $uri);
|
||||||
$message_id = "<" . $resource . "@" . $host . ">";
|
$message_id = "<" . $resource . "@" . $host . ">";
|
||||||
DI::logger()->debug('generated message ID', ['id' => $message_id, 'uri' => $uri]);
|
Logger::debug('generated message ID', ['id' => $message_id, 'uri' => $uri]);
|
||||||
return $message_id;
|
return $message_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,20 +95,20 @@ function mailstream_send_hook(array $data)
|
||||||
$criteria = array('uid' => $data['uid'], 'contact-id' => $data['contact-id'], 'uri' => $data['uri']);
|
$criteria = array('uid' => $data['uid'], 'contact-id' => $data['contact-id'], 'uri' => $data['uri']);
|
||||||
$item = Post::selectFirst([], $criteria);
|
$item = Post::selectFirst([], $criteria);
|
||||||
if (empty($item)) {
|
if (empty($item)) {
|
||||||
DI::logger()->error('could not find item');
|
Logger::error('could not find item');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::getById($item['uid']);
|
$user = User::getById($item['uid']);
|
||||||
if (empty($user)) {
|
if (empty($user)) {
|
||||||
DI::logger()->error('could not find user', ['uid' => $item['uid']]);
|
Logger::error('could not find user', ['uid' => $item['uid']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mailstream_send($data['message_id'], $item, $user)) {
|
if (!mailstream_send($data['message_id'], $item, $user)) {
|
||||||
DI::logger()->debug('send failed, will retry', $data);
|
Logger::debug('send failed, will retry', $data);
|
||||||
if (!Worker::defer()) {
|
if (!Worker::defer()) {
|
||||||
DI::logger()->error('failed and could not defer', $data);
|
Logger::error('failed and could not defer', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,32 +124,32 @@ function mailstream_send_hook(array $data)
|
||||||
function mailstream_post_hook(array &$item)
|
function mailstream_post_hook(array &$item)
|
||||||
{
|
{
|
||||||
if ($item['uid'] === 0) {
|
if ($item['uid'] === 0) {
|
||||||
DI::logger()->debug('mailstream: root user, skipping item ' . $item['id']);
|
Logger::debug('mailstream: root user, skipping item ' . $item['id']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) {
|
if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) {
|
||||||
DI::logger()->debug('mailstream: not enabled.', ['item' => $item['id'], ' uid ' => $item['uid']]);
|
Logger::debug('mailstream: not enabled.', ['item' => $item['id'], ' uid ' => $item['uid']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!$item['contact-id']) {
|
if (!$item['contact-id']) {
|
||||||
DI::logger()->debug('no contact-id', ['item' => $item['id']]);
|
Logger::debug('no contact-id', ['item' => $item['id']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!$item['uri']) {
|
if (!$item['uri']) {
|
||||||
DI::logger()->debug('no uri', ['item' => $item['id']]);
|
Logger::debug('no uri', ['item' => $item['id']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($item['verb'] == Activity::ANNOUNCE) {
|
if ($item['verb'] == Activity::ANNOUNCE) {
|
||||||
DI::logger()->debug('ignoring announce', ['item' => $item['id']]);
|
Logger::debug('ignoring announce', ['item' => $item['id']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (DI::pConfig()->get($item['uid'], 'mailstream', 'nolikes')) {
|
if (DI::pConfig()->get($item['uid'], 'mailstream', 'nolikes')) {
|
||||||
if ($item['verb'] == Activity::LIKE) {
|
if ($item['verb'] == Activity::LIKE) {
|
||||||
DI::logger()->debug('ignoring like', ['item' => $item['id']]);
|
Logger::debug('ignoring like', ['item' => $item['id']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($item['verb'] == Activity::DISLIKE) {
|
if ($item['verb'] == Activity::DISLIKE) {
|
||||||
DI::logger()->debug('ignoring dislike', ['item' => $item['id']]);
|
Logger::debug('ignoring dislike', ['item' => $item['id']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,7 +180,7 @@ function mailstream_post_hook(array &$item)
|
||||||
function mailstream_do_images(array &$item, array &$attachments)
|
function mailstream_do_images(array &$item, array &$attachments)
|
||||||
{
|
{
|
||||||
if (!DI::pConfig()->get($item['uid'], 'mailstream', 'attachimg')) {
|
if (!DI::pConfig()->get($item['uid'], 'mailstream', 'attachimg')) {
|
||||||
return $attachments;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$attachments = [];
|
$attachments = [];
|
||||||
|
@ -199,7 +200,7 @@ function mailstream_do_images(array &$item, array &$attachments)
|
||||||
try {
|
try {
|
||||||
$curlResult = DI::httpClient()->get($url, HttpClientAccept::DEFAULT, [HttpClientOptions::COOKIEJAR => $cookiejar]);
|
$curlResult = DI::httpClient()->get($url, HttpClientAccept::DEFAULT, [HttpClientOptions::COOKIEJAR => $cookiejar]);
|
||||||
if (!$curlResult->isSuccess()) {
|
if (!$curlResult->isSuccess()) {
|
||||||
DI::logger()->debug('mailstream: fetch image url failed', [
|
Logger::debug('mailstream: fetch image url failed', [
|
||||||
'url' => $url,
|
'url' => $url,
|
||||||
'item_id' => $item['id'],
|
'item_id' => $item['id'],
|
||||||
'return_code' => $curlResult->getReturnCode()
|
'return_code' => $curlResult->getReturnCode()
|
||||||
|
@ -207,7 +208,7 @@ function mailstream_do_images(array &$item, array &$attachments)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} catch (InvalidArgumentException $e) {
|
} catch (InvalidArgumentException $e) {
|
||||||
DI::logger()->error('exception fetching url', ['url' => $url, 'item_id' => $item['id']]);
|
Logger::error('exception fetching url', ['url' => $url, 'item_id' => $item['id']]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$attachments[$url] = [
|
$attachments[$url] = [
|
||||||
|
@ -308,7 +309,7 @@ function mailstream_subject(array $item): string
|
||||||
}
|
}
|
||||||
$contact = Contact::selectFirst([], ['id' => $item['contact-id'], 'uid' => $item['uid']]);
|
$contact = Contact::selectFirst([], ['id' => $item['contact-id'], 'uid' => $item['uid']]);
|
||||||
if (!DBA::isResult($contact)) {
|
if (!DBA::isResult($contact)) {
|
||||||
DI::logger()->error('no contact', [
|
Logger::error('no contact', [
|
||||||
'item' => $item['id'],
|
'item' => $item['id'],
|
||||||
'plink' => $item['plink'],
|
'plink' => $item['plink'],
|
||||||
'contact id' => $item['contact-id'],
|
'contact id' => $item['contact-id'],
|
||||||
|
@ -350,16 +351,16 @@ function mailstream_subject(array $item): string
|
||||||
function mailstream_send(string $message_id, array $item, array $user): bool
|
function mailstream_send(string $message_id, array $item, array $user): bool
|
||||||
{
|
{
|
||||||
if (!is_array($item)) {
|
if (!is_array($item)) {
|
||||||
DI::logger()->error('item is empty', ['message_id' => $message_id]);
|
Logger::error('item is empty', ['message_id' => $message_id]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$item['visible']) {
|
if (!$item['visible']) {
|
||||||
DI::logger()->debug('item not yet visible', ['item uri' => $item['uri']]);
|
Logger::debug('item not yet visible', ['item uri' => $item['uri']]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!$message_id) {
|
if (!$message_id) {
|
||||||
DI::logger()->error('no message ID supplied', ['item uri' => $item['uri'], 'user email' => $user['email']]);
|
Logger::error('no message ID supplied', ['item uri' => $item['uri'], 'user email' => $user['email']]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -417,15 +418,15 @@ function mailstream_send(string $message_id, array $item, array $user): bool
|
||||||
if (!$mail->Send()) {
|
if (!$mail->Send()) {
|
||||||
throw new Exception($mail->ErrorInfo);
|
throw new Exception($mail->ErrorInfo);
|
||||||
}
|
}
|
||||||
DI::logger()->debug('sent message', [
|
Logger::debug('sent message', [
|
||||||
'message ID' => $mail->MessageID,
|
'message ID' => $mail->MessageID,
|
||||||
'subject' => $mail->Subject,
|
'subject' => $mail->Subject,
|
||||||
'address' => $address
|
'address' => $address
|
||||||
]);
|
]);
|
||||||
} catch (phpmailerException $e) {
|
} catch (phpmailerException $e) {
|
||||||
DI::logger()->debug('PHPMailer exception sending message', ['id' => $message_id, 'error' => $e->errorMessage()]);
|
Logger::debug('PHPMailer exception sending message', ['id' => $message_id, 'error' => $e->errorMessage()]);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
DI::logger()->debug('exception sending message', ['id' => $message_id, 'error' => $e->getMessage()]);
|
Logger::debug('exception sending message', ['id' => $message_id, 'error' => $e->getMessage()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
* Version: 0.1
|
* Version: 0.1
|
||||||
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
||||||
*/
|
*/
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Content\Text\Markdown;
|
use Friendica\Content\Text\Markdown;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
|
@ -26,7 +27,7 @@ function markdown_addon_settings(array &$data)
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/');
|
||||||
$html = Renderer::replaceMacros($t, [
|
$html = Renderer::replaceMacros($t, [
|
||||||
'$enabled' => ['markdown-enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, adds Markdown support to the Compose Post form.')],
|
'$enabled' => ['enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, adds Markdown support to the Compose Post form.')],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
|
@ -42,7 +43,7 @@ function markdown_addon_settings_post(array &$b)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'markdown', 'enabled', intval($_POST['markdown-enabled']));
|
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'markdown', 'enabled', intval($_POST['enabled']));
|
||||||
}
|
}
|
||||||
|
|
||||||
function markdown_post_local_start(&$request) {
|
function markdown_post_local_start(&$request) {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
* License: 3-clause BSD license
|
* License: 3-clause BSD license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
|
@ -17,11 +17,7 @@ function membersince_install()
|
||||||
Hook::register('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
|
Hook::register('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function membersince_display(array &$b)
|
||||||
* @param array|string|null $b
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function membersince_display(&$b)
|
|
||||||
{
|
{
|
||||||
$uid = DI::userSession()->getLocalUserId();
|
$uid = DI::userSession()->getLocalUserId();
|
||||||
|
|
||||||
|
@ -63,7 +59,7 @@ function membersince_display(&$b)
|
||||||
$div->appendChild($entry);
|
$div->appendChild($entry);
|
||||||
$elm->parentNode->insertBefore($div, $elm->nextSibling);
|
$elm->parentNode->insertBefore($div, $elm->nextSibling);
|
||||||
|
|
||||||
$b = (string) $doc->saveHTML();
|
$b = $doc->saveHTML();
|
||||||
} else {
|
} else {
|
||||||
// Works in Vier.
|
// Works in Vier.
|
||||||
$b = preg_replace('/<\/dl>/', "</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . DI::l10n()->t('Member since:') . "</dt>\n<dd>" . DateTimeFormat::local($user['register_date']) . "</dd>\n</dl>", $b, 1);
|
$b = preg_replace('/<\/dl>/', "</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . DI::l10n()->t('Member since:') . "</dt>\n<dd>" . DateTimeFormat::local($user['register_date']) . "</dd>\n</dl>", $b, 1);
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
# Monolog Addon
|
|
||||||
|
|
||||||
A Logging framework with lots of additions (see [Monolog](https://github.com/Seldaek/monolog/)).
|
|
||||||
There are just Friendica additions inside the src directory.
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Name: Monolog
|
* Name: Monolog
|
||||||
* Description: A Logging framework with lots of additions, customized for Friendica.
|
* Description: A Logging framework with lots of additions (see [Monolog](https://github.com/Seldaek/monolog/)). There are just Friendica additions inside the src directory
|
||||||
* Version: 1.1
|
* Version: 1.0
|
||||||
* Author: Philipp Holzer
|
* Author: Philipp Holzer
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -4,8 +4,7 @@ namespace Friendica\Addon\monolog\src\Factory;
|
||||||
|
|
||||||
use Friendica\Addon\monolog\src\Monolog\IntrospectionProcessor;
|
use Friendica\Addon\monolog\src\Monolog\IntrospectionProcessor;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\Logger\Capability\IHaveCallIntrospections;
|
use Friendica\Core\Logger\Factory\AbstractLoggerTypeFactory;
|
||||||
use Friendica\Core\Logger\Factory\LoggerFactory;
|
|
||||||
use Monolog\Formatter\LineFormatter;
|
use Monolog\Formatter\LineFormatter;
|
||||||
use Monolog\Handler\StreamHandler;
|
use Monolog\Handler\StreamHandler;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
|
@ -17,49 +16,32 @@ use Psr\Log\LogLevel;
|
||||||
|
|
||||||
require_once __DIR__ . '/../../vendor/autoload.php';
|
require_once __DIR__ . '/../../vendor/autoload.php';
|
||||||
|
|
||||||
final class MonologFactory implements LoggerFactory
|
class Monolog extends AbstractLoggerTypeFactory
|
||||||
{
|
{
|
||||||
private IHaveCallIntrospections $introspection;
|
public function create(IManageConfigValues $config, string $loglevel = null): LoggerInterface
|
||||||
|
|
||||||
private IManageConfigValues $config;
|
|
||||||
|
|
||||||
public function __construct(IHaveCallIntrospections $introspection, IManageConfigValues $config)
|
|
||||||
{
|
|
||||||
$this->introspection = $introspection;
|
|
||||||
$this->config = $config;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates and returns a PSR-3 Logger instance.
|
|
||||||
*
|
|
||||||
* Calling this method multiple times with the same parameters SHOULD return the same object.
|
|
||||||
*
|
|
||||||
* @param \Psr\Log\LogLevel::* $logLevel The log level
|
|
||||||
* @param \Friendica\Core\Logger\Capability\LogChannel::* $logChannel The log channel
|
|
||||||
*/
|
|
||||||
public function createLogger(string $logLevel, string $logChannel): LoggerInterface
|
|
||||||
{
|
{
|
||||||
$loggerTimeZone = new \DateTimeZone('UTC');
|
$loggerTimeZone = new \DateTimeZone('UTC');
|
||||||
|
|
||||||
$logger = new Logger($logChannel);
|
$logger = new Logger($this->channel);
|
||||||
$logger->setTimezone($loggerTimeZone);
|
$logger->setTimezone($loggerTimeZone);
|
||||||
$logger->pushProcessor(new PsrLogMessageProcessor());
|
$logger->pushProcessor(new PsrLogMessageProcessor());
|
||||||
$logger->pushProcessor(new ProcessIdProcessor());
|
$logger->pushProcessor(new ProcessIdProcessor());
|
||||||
$logger->pushProcessor(new UidProcessor());
|
$logger->pushProcessor(new UidProcessor());
|
||||||
$logger->pushProcessor(new IntrospectionProcessor($this->introspection, LogLevel::DEBUG));
|
$logger->pushProcessor(new IntrospectionProcessor($this->introspection, LogLevel::DEBUG));
|
||||||
|
|
||||||
$logfile = $this->config->get('system', 'logfile');
|
$logfile = $config->get('system', 'logfile');
|
||||||
|
|
||||||
// just add a stream in case it's either writable or not file
|
// just add a stream in case it's either writable or not file
|
||||||
if (is_writable($logfile)) {
|
if (is_writable($logfile)) {
|
||||||
$logLevel = Logger::toMonologLevel($logLevel);
|
$loglevel = $loglevel ?? static::mapLegacyConfigDebugLevel($config->get('system', 'loglevel'));
|
||||||
|
$loglevel = Logger::toMonologLevel($loglevel);
|
||||||
|
|
||||||
// fallback to notice if an invalid loglevel is set
|
// fallback to notice if an invalid loglevel is set
|
||||||
if (!is_int($logLevel)) {
|
if (!is_int($loglevel)) {
|
||||||
$logLevel = LogLevel::NOTICE;
|
$loglevel = LogLevel::NOTICE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fileHandler = new StreamHandler($logfile, $logLevel);
|
$fileHandler = new StreamHandler($logfile, $loglevel);
|
||||||
|
|
||||||
$formatter = new LineFormatter("%datetime% %channel% [%level_name%]: %message% %context% %extra%\n");
|
$formatter = new LineFormatter("%datetime% %channel% [%level_name%]: %message% %context% %extra%\n");
|
||||||
$fileHandler->setFormatter($formatter);
|
$fileHandler->setFormatter($formatter);
|
|
@ -20,8 +20,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return [
|
return [
|
||||||
\Friendica\Core\Logger\Factory\LoggerFactory::class => [
|
\Monolog\Logger::class => [
|
||||||
'instanceOf' => \Friendica\Addon\monolog\src\Factory\MonologFactory::class,
|
'instanceOf' => \Friendica\Addon\monolog\src\Factory\Monolog::class,
|
||||||
'call' => null,
|
'call' => [
|
||||||
|
['create', [], \Dice\Dice::CHAIN_CALL],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
26
monolog/static/strategies.config.php
Normal file
26
monolog/static/strategies.config.php
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @copyright Copyright (C) 2010-2023, the Friendica project
|
||||||
|
*
|
||||||
|
* @license GNU AGPL version 3 or any later version
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
return [
|
||||||
|
\Psr\Log\LoggerInterface::class => [
|
||||||
|
\Monolog\Logger::class => ['monolog'],
|
||||||
|
],
|
||||||
|
];
|
|
@ -8,6 +8,7 @@
|
||||||
* Status: Deprecated
|
* Status: Deprecated
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,10 @@
|
||||||
* Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
|
* Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
|
@ -15,7 +17,7 @@ use Friendica\Model\User;
|
||||||
function newmemberwidget_install()
|
function newmemberwidget_install()
|
||||||
{
|
{
|
||||||
Hook::register( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
|
Hook::register( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
|
||||||
DI::logger()->notice('newmemberwidget installed');
|
Logger::notice('newmemberwidget installed');
|
||||||
}
|
}
|
||||||
|
|
||||||
function newmemberwidget_network_mod_init ($b)
|
function newmemberwidget_network_mod_init ($b)
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
@ -44,19 +46,19 @@ function nominatim_resolve_item(array &$item)
|
||||||
|
|
||||||
$s = DI::httpClient()->fetch('https://nominatim.openstreetmap.org/reverse?lat=' . $coords[0] . '&lon=' . $coords[1] . '&format=json&addressdetails=0&accept-language=' . $language);
|
$s = DI::httpClient()->fetch('https://nominatim.openstreetmap.org/reverse?lat=' . $coords[0] . '&lon=' . $coords[1] . '&format=json&addressdetails=0&accept-language=' . $language);
|
||||||
if (empty($s)) {
|
if (empty($s)) {
|
||||||
DI::logger()->info('API could not be queried');
|
Logger::info('API could not be queried');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = json_decode($s, true);
|
$data = json_decode($s, true);
|
||||||
if (empty($data['display_name'])) {
|
if (empty($data['display_name'])) {
|
||||||
DI::logger()->info('No results found for coordinates', ['coordinates' => $item['coord'], 'data' => $data]);
|
Logger::info('No results found for coordinates', ['coordinates' => $item['coord'], 'data' => $data]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$item['location'] = $data['display_name'];
|
$item['location'] = $data['display_name'];
|
||||||
|
|
||||||
DI::logger()->info('Got location', ['lat' => $coords[0], 'long' => $coords[1], 'location' => $item['location']]);
|
Logger::info('Got location', ['lat' => $coords[0], 'long' => $coords[1], 'location' => $item['location']]);
|
||||||
|
|
||||||
if (!empty($item['location'])) {
|
if (!empty($item['location'])) {
|
||||||
DI::cache()->set('nominatim:' . $language . ':' . $coords[0] . '-' . $coords[1], $item['location']);
|
DI::cache()->set('nominatim:' . $language . ':' . $coords[0] . '-' . $coords[1], $item['location']);
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\Addon\notifyall\NotifyAllEmail;
|
use Friendica\Addon\notifyall\NotifyAllEmail;
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
@ -57,7 +59,7 @@ function notifyall_post()
|
||||||
|
|
||||||
$notifyEmail = new NotifyAllEmail(DI::l10n(), DI::config(), DI::baseUrl(), $text);
|
$notifyEmail = new NotifyAllEmail(DI::l10n(), DI::config(), DI::baseUrl(), $text);
|
||||||
|
|
||||||
foreach (DBA::toArray($recipients) as $recipient) {
|
foreach ($recipients as $recipient) {
|
||||||
DI::emailer()->send($notifyEmail->withRecipient($recipient['email']));
|
DI::emailer()->send($notifyEmail->withRecipient($recipient['email']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,13 +104,12 @@ function nsfw_addon_settings_post(array &$b)
|
||||||
function nsfw_prepare_body_content_filter(&$hook_data)
|
function nsfw_prepare_body_content_filter(&$hook_data)
|
||||||
{
|
{
|
||||||
$words = null;
|
$words = null;
|
||||||
$uid = $hook_data['uid'] ?? DI::userSession()->getLocalUserId();
|
if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'nsfw', 'disable')) {
|
||||||
if (DI::pConfig()->get($uid, 'nsfw', 'disable')) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($uid) {
|
if (DI::userSession()->getLocalUserId()) {
|
||||||
$words = DI::pConfig()->get($uid, 'nsfw', 'words');
|
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'nsfw', 'words');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($words) {
|
if ($words) {
|
||||||
|
@ -137,10 +136,10 @@ function nsfw_prepare_body_content_filter(&$hook_data)
|
||||||
break;
|
break;
|
||||||
case '#': // Hashtag-only search
|
case '#': // Hashtag-only search
|
||||||
$tag_search = true;
|
$tag_search = true;
|
||||||
$found = nsfw_find_word_in_item_tags($hook_data['item']['hashtags'] ?? [], substr($word, 1));
|
$found = nsfw_find_word_in_item_tags($hook_data['item']['hashtags'], substr($word, 1));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$found = strpos($body, $word) !== false || nsfw_find_word_in_item_tags($hook_data['item']['tags'] ?? [], $word);
|
$found = strpos($body, $word) !== false || nsfw_find_word_in_item_tags($hook_data['item']['tags'], $word);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
@ -15,7 +17,7 @@ function numfriends_install() {
|
||||||
Hook::register('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
|
Hook::register('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
|
||||||
Hook::register('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
|
Hook::register('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
|
||||||
|
|
||||||
DI::logger()->notice("installed numfriends");
|
Logger::notice("installed numfriends");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,7 +39,7 @@ function numfriends_settings_post($post) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Called from the Addon Setting form.
|
* Called from the Addon Setting form.
|
||||||
* Add our own settings info to the page.
|
* Add our own settings info to the page.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -48,7 +50,7 @@ function numfriends_settings(array &$data)
|
||||||
}
|
}
|
||||||
|
|
||||||
$numfriends = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'display_friend_count', 24);
|
$numfriends = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'display_friend_count', 24);
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/numfriends/');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/numfriends/');
|
||||||
$html = Renderer::replaceMacros($t, [
|
$html = Renderer::replaceMacros($t, [
|
||||||
'$numfriends' => ['numfriends', DI::l10n()->t('How many contacts to display on profile sidebar'), $numfriends],
|
'$numfriends' => ['numfriends', DI::l10n()->t('How many contacts to display on profile sidebar'), $numfriends],
|
||||||
|
|
|
@ -9,8 +9,10 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Cache\Enum\Duration;
|
use Friendica\Core\Cache\Enum\Duration;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Core\Config\Util\ConfigFileManager;
|
use Friendica\Core\Config\Util\ConfigFileManager;
|
||||||
|
@ -30,12 +32,12 @@ function openstreetmap_install()
|
||||||
Hook::register('Map::getCoordinates', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_get_coordinates');
|
Hook::register('Map::getCoordinates', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_get_coordinates');
|
||||||
Hook::register('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader');
|
Hook::register('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader');
|
||||||
|
|
||||||
DI::logger()->notice("installed openstreetmap");
|
Logger::notice("installed openstreetmap");
|
||||||
}
|
}
|
||||||
|
|
||||||
function openstreetmap_load_config(ConfigFileManager $loader)
|
function openstreetmap_load_config(ConfigFileManager $loader)
|
||||||
{
|
{
|
||||||
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('openstreetmap'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
DI::app()->getConfigCache()->load($loader->loadAddonConfig('openstreetmap'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openstreetmap_alterheader(&$navHtml)
|
function openstreetmap_alterheader(&$navHtml)
|
||||||
|
@ -153,8 +155,8 @@ function openstreetmap_generate_map(array &$b)
|
||||||
$lat = $b['lat']; // round($b['lat'], 5);
|
$lat = $b['lat']; // round($b['lat'], 5);
|
||||||
$lon = $b['lon']; // round($b['lon'], 5);
|
$lon = $b['lon']; // round($b['lon'], 5);
|
||||||
|
|
||||||
DI::logger()->debug('lat: ' . $lat);
|
Logger::debug('lat: ' . $lat);
|
||||||
DI::logger()->debug('lon: ' . $lon);
|
Logger::debug('lon: ' . $lon);
|
||||||
|
|
||||||
$cardlink = '<a href="' . $tmsserver;
|
$cardlink = '<a href="' . $tmsserver;
|
||||||
|
|
||||||
|
@ -172,7 +174,7 @@ function openstreetmap_generate_map(array &$b)
|
||||||
$b['html'] .= '<br/>' . $cardlink;
|
$b['html'] .= '<br/>' . $cardlink;
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::logger()->debug('generate_map: ' . $b['html']);
|
Logger::debug('generate_map: ' . $b['html']);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openstreetmap_addon_admin(string &$o)
|
function openstreetmap_addon_admin(string &$o)
|
||||||
|
|
|
@ -8,7 +8,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Network\HTTPException;
|
||||||
|
use Friendica\Database\DBA;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
|
@ -17,7 +22,7 @@ function opmlexport_install()
|
||||||
{
|
{
|
||||||
Hook::register('addon_settings', __FILE__, 'opmlexport_addon_settings');
|
Hook::register('addon_settings', __FILE__, 'opmlexport_addon_settings');
|
||||||
Hook::register('addon_settings_post', __FILE__, 'opmlexport_addon_settings_post');
|
Hook::register('addon_settings_post', __FILE__, 'opmlexport_addon_settings_post');
|
||||||
DI::logger()->notice('installed opmlexport Addon');
|
Logger::notice('installed opmlexport Addon');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,10 @@
|
||||||
* Version: 1.1
|
* Version: 1.1
|
||||||
* Author: Keith Fernie <http://friendika.me4.it/profile/keith>
|
* Author: Keith Fernie <http://friendika.me4.it/profile/keith>
|
||||||
* Hauke Altmann <https://snarl.de/profile/tugelblend>
|
* Hauke Altmann <https://snarl.de/profile/tugelblend>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
20
phpmailer/composer.lock
generated
20
phpmailer/composer.lock
generated
|
@ -8,16 +8,16 @@
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "phpmailer/phpmailer",
|
"name": "phpmailer/phpmailer",
|
||||||
"version": "v6.10.0",
|
"version": "v6.9.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||||
"reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144"
|
"reference": "039de174cd9c17a8389754d3b877a2ed22743e18"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144",
|
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18",
|
||||||
"reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144",
|
"reference": "039de174cd9c17a8389754d3b877a2ed22743e18",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -75,28 +75,24 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
|
||||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.10.0"
|
|
||||||
},
|
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://github.com/Synchro",
|
"url": "https://github.com/Synchro",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-04-24T15:19:31+00:00"
|
"time": "2023-11-25T22:23:28+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [],
|
"packages-dev": [],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": {},
|
"stability-flags": [],
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": ">=7.0"
|
"php": ">=7.0"
|
||||||
},
|
},
|
||||||
"platform-dev": {},
|
"platform-dev": [],
|
||||||
"plugin-api-version": "2.6.0"
|
"plugin-api-version": "1.1.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
* Maintainer: Hypolite Petovan <hypolite@friendica.mrpetovan.com>
|
* Maintainer: Hypolite Petovan <hypolite@friendica.mrpetovan.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Object\EMail\IEmail;
|
use Friendica\Object\EMail\IEmail;
|
||||||
|
@ -24,18 +25,14 @@ function phpmailer_install()
|
||||||
|
|
||||||
function phpmailer_load_config(ConfigFileManager $loader)
|
function phpmailer_load_config(ConfigFileManager $loader)
|
||||||
{
|
{
|
||||||
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('phpmailer'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
DI::app()->getConfigCache()->load($loader->loadAddonConfig('phpmailer'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param null|IEmail $email
|
* @param IEmail $email
|
||||||
*/
|
*/
|
||||||
function phpmailer_emailer_send_prepare(?IEmail &$email)
|
function phpmailer_emailer_send_prepare(IEmail &$email)
|
||||||
{
|
{
|
||||||
if ($email === null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Passing `true` enables exceptions
|
// Passing `true` enables exceptions
|
||||||
$mailer = new PHPMailer(true);
|
$mailer = new PHPMailer(true);
|
||||||
try {
|
try {
|
||||||
|
|
18
phpmailer/vendor/autoload.php
vendored
18
phpmailer/vendor/autoload.php
vendored
|
@ -2,24 +2,6 @@
|
||||||
|
|
||||||
// autoload.php @generated by Composer
|
// autoload.php @generated by Composer
|
||||||
|
|
||||||
if (PHP_VERSION_ID < 50600) {
|
|
||||||
if (!headers_sent()) {
|
|
||||||
header('HTTP/1.1 500 Internal Server Error');
|
|
||||||
}
|
|
||||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
|
||||||
if (!ini_get('display_errors')) {
|
|
||||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
|
||||||
fwrite(STDERR, $err);
|
|
||||||
} elseif (!headers_sent()) {
|
|
||||||
echo $err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
trigger_error(
|
|
||||||
$err,
|
|
||||||
E_USER_ERROR
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInitPhpMailerAddon::getLoader();
|
return ComposerAutoloaderInitPhpMailerAddon::getLoader();
|
||||||
|
|
204
phpmailer/vendor/composer/ClassLoader.php
vendored
204
phpmailer/vendor/composer/ClassLoader.php
vendored
|
@ -37,81 +37,26 @@ namespace Composer\Autoload;
|
||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||||
* @see https://www.php-fig.org/psr/psr-0/
|
* @see http://www.php-fig.org/psr/psr-0/
|
||||||
* @see https://www.php-fig.org/psr/psr-4/
|
* @see http://www.php-fig.org/psr/psr-4/
|
||||||
*/
|
*/
|
||||||
class ClassLoader
|
class ClassLoader
|
||||||
{
|
{
|
||||||
/** @var \Closure(string):void */
|
|
||||||
private static $includeFile;
|
|
||||||
|
|
||||||
/** @var string|null */
|
|
||||||
private $vendorDir;
|
|
||||||
|
|
||||||
// PSR-4
|
// PSR-4
|
||||||
/**
|
|
||||||
* @var array<string, array<string, int>>
|
|
||||||
*/
|
|
||||||
private $prefixLengthsPsr4 = array();
|
private $prefixLengthsPsr4 = array();
|
||||||
/**
|
|
||||||
* @var array<string, list<string>>
|
|
||||||
*/
|
|
||||||
private $prefixDirsPsr4 = array();
|
private $prefixDirsPsr4 = array();
|
||||||
/**
|
|
||||||
* @var list<string>
|
|
||||||
*/
|
|
||||||
private $fallbackDirsPsr4 = array();
|
private $fallbackDirsPsr4 = array();
|
||||||
|
|
||||||
// PSR-0
|
// PSR-0
|
||||||
/**
|
|
||||||
* List of PSR-0 prefixes
|
|
||||||
*
|
|
||||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
|
||||||
*
|
|
||||||
* @var array<string, array<string, list<string>>>
|
|
||||||
*/
|
|
||||||
private $prefixesPsr0 = array();
|
private $prefixesPsr0 = array();
|
||||||
/**
|
|
||||||
* @var list<string>
|
|
||||||
*/
|
|
||||||
private $fallbackDirsPsr0 = array();
|
private $fallbackDirsPsr0 = array();
|
||||||
|
|
||||||
/** @var bool */
|
|
||||||
private $useIncludePath = false;
|
private $useIncludePath = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array<string, string>
|
|
||||||
*/
|
|
||||||
private $classMap = array();
|
private $classMap = array();
|
||||||
|
|
||||||
/** @var bool */
|
|
||||||
private $classMapAuthoritative = false;
|
private $classMapAuthoritative = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array<string, bool>
|
|
||||||
*/
|
|
||||||
private $missingClasses = array();
|
private $missingClasses = array();
|
||||||
|
|
||||||
/** @var string|null */
|
|
||||||
private $apcuPrefix;
|
private $apcuPrefix;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array<string, self>
|
|
||||||
*/
|
|
||||||
private static $registeredLoaders = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string|null $vendorDir
|
|
||||||
*/
|
|
||||||
public function __construct($vendorDir = null)
|
|
||||||
{
|
|
||||||
$this->vendorDir = $vendorDir;
|
|
||||||
self::initializeIncludeClosure();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array<string, list<string>>
|
|
||||||
*/
|
|
||||||
public function getPrefixes()
|
public function getPrefixes()
|
||||||
{
|
{
|
||||||
if (!empty($this->prefixesPsr0)) {
|
if (!empty($this->prefixesPsr0)) {
|
||||||
|
@ -121,42 +66,28 @@ class ClassLoader
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array<string, list<string>>
|
|
||||||
*/
|
|
||||||
public function getPrefixesPsr4()
|
public function getPrefixesPsr4()
|
||||||
{
|
{
|
||||||
return $this->prefixDirsPsr4;
|
return $this->prefixDirsPsr4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return list<string>
|
|
||||||
*/
|
|
||||||
public function getFallbackDirs()
|
public function getFallbackDirs()
|
||||||
{
|
{
|
||||||
return $this->fallbackDirsPsr0;
|
return $this->fallbackDirsPsr0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return list<string>
|
|
||||||
*/
|
|
||||||
public function getFallbackDirsPsr4()
|
public function getFallbackDirsPsr4()
|
||||||
{
|
{
|
||||||
return $this->fallbackDirsPsr4;
|
return $this->fallbackDirsPsr4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array<string, string> Array of classname => path
|
|
||||||
*/
|
|
||||||
public function getClassMap()
|
public function getClassMap()
|
||||||
{
|
{
|
||||||
return $this->classMap;
|
return $this->classMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<string, string> $classMap Class to filename map
|
* @param array $classMap Class to filename map
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function addClassMap(array $classMap)
|
public function addClassMap(array $classMap)
|
||||||
{
|
{
|
||||||
|
@ -171,25 +102,22 @@ class ClassLoader
|
||||||
* Registers a set of PSR-0 directories for a given prefix, either
|
* Registers a set of PSR-0 directories for a given prefix, either
|
||||||
* appending or prepending to the ones previously set for this prefix.
|
* appending or prepending to the ones previously set for this prefix.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix
|
* @param string $prefix The prefix
|
||||||
* @param list<string>|string $paths The PSR-0 root directories
|
* @param array|string $paths The PSR-0 root directories
|
||||||
* @param bool $prepend Whether to prepend the directories
|
* @param bool $prepend Whether to prepend the directories
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function add($prefix, $paths, $prepend = false)
|
public function add($prefix, $paths, $prepend = false)
|
||||||
{
|
{
|
||||||
$paths = (array) $paths;
|
|
||||||
if (!$prefix) {
|
if (!$prefix) {
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
$this->fallbackDirsPsr0 = array_merge(
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
$paths,
|
(array) $paths,
|
||||||
$this->fallbackDirsPsr0
|
$this->fallbackDirsPsr0
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->fallbackDirsPsr0 = array_merge(
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
$this->fallbackDirsPsr0,
|
$this->fallbackDirsPsr0,
|
||||||
$paths
|
(array) $paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,19 +126,19 @@ class ClassLoader
|
||||||
|
|
||||||
$first = $prefix[0];
|
$first = $prefix[0];
|
||||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
$paths,
|
(array) $paths,
|
||||||
$this->prefixesPsr0[$first][$prefix]
|
$this->prefixesPsr0[$first][$prefix]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
$this->prefixesPsr0[$first][$prefix],
|
$this->prefixesPsr0[$first][$prefix],
|
||||||
$paths
|
(array) $paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,28 +147,25 @@ class ClassLoader
|
||||||
* Registers a set of PSR-4 directories for a given namespace, either
|
* Registers a set of PSR-4 directories for a given namespace, either
|
||||||
* appending or prepending to the ones previously set for this namespace.
|
* appending or prepending to the ones previously set for this namespace.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
* @param list<string>|string $paths The PSR-4 base directories
|
* @param array|string $paths The PSR-4 base directories
|
||||||
* @param bool $prepend Whether to prepend the directories
|
* @param bool $prepend Whether to prepend the directories
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function addPsr4($prefix, $paths, $prepend = false)
|
public function addPsr4($prefix, $paths, $prepend = false)
|
||||||
{
|
{
|
||||||
$paths = (array) $paths;
|
|
||||||
if (!$prefix) {
|
if (!$prefix) {
|
||||||
// Register directories for the root namespace.
|
// Register directories for the root namespace.
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
$this->fallbackDirsPsr4 = array_merge(
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
$paths,
|
(array) $paths,
|
||||||
$this->fallbackDirsPsr4
|
$this->fallbackDirsPsr4
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->fallbackDirsPsr4 = array_merge(
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
$this->fallbackDirsPsr4,
|
$this->fallbackDirsPsr4,
|
||||||
$paths
|
(array) $paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||||
|
@ -250,18 +175,18 @@ class ClassLoader
|
||||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||||
}
|
}
|
||||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||||
$this->prefixDirsPsr4[$prefix] = $paths;
|
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||||
} elseif ($prepend) {
|
} elseif ($prepend) {
|
||||||
// Prepend directories for an already registered namespace.
|
// Prepend directories for an already registered namespace.
|
||||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
$paths,
|
(array) $paths,
|
||||||
$this->prefixDirsPsr4[$prefix]
|
$this->prefixDirsPsr4[$prefix]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Append directories for an already registered namespace.
|
// Append directories for an already registered namespace.
|
||||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
$this->prefixDirsPsr4[$prefix],
|
$this->prefixDirsPsr4[$prefix],
|
||||||
$paths
|
(array) $paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -270,10 +195,8 @@ class ClassLoader
|
||||||
* Registers a set of PSR-0 directories for a given prefix,
|
* Registers a set of PSR-0 directories for a given prefix,
|
||||||
* replacing any others previously set for this prefix.
|
* replacing any others previously set for this prefix.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix
|
* @param string $prefix The prefix
|
||||||
* @param list<string>|string $paths The PSR-0 base directories
|
* @param array|string $paths The PSR-0 base directories
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function set($prefix, $paths)
|
public function set($prefix, $paths)
|
||||||
{
|
{
|
||||||
|
@ -288,12 +211,10 @@ class ClassLoader
|
||||||
* Registers a set of PSR-4 directories for a given namespace,
|
* Registers a set of PSR-4 directories for a given namespace,
|
||||||
* replacing any others previously set for this namespace.
|
* replacing any others previously set for this namespace.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
* @param list<string>|string $paths The PSR-4 base directories
|
* @param array|string $paths The PSR-4 base directories
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function setPsr4($prefix, $paths)
|
public function setPsr4($prefix, $paths)
|
||||||
{
|
{
|
||||||
|
@ -313,8 +234,6 @@ class ClassLoader
|
||||||
* Turns on searching the include path for class files.
|
* Turns on searching the include path for class files.
|
||||||
*
|
*
|
||||||
* @param bool $useIncludePath
|
* @param bool $useIncludePath
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function setUseIncludePath($useIncludePath)
|
public function setUseIncludePath($useIncludePath)
|
||||||
{
|
{
|
||||||
|
@ -337,8 +256,6 @@ class ClassLoader
|
||||||
* that have not been registered with the class map.
|
* that have not been registered with the class map.
|
||||||
*
|
*
|
||||||
* @param bool $classMapAuthoritative
|
* @param bool $classMapAuthoritative
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||||
{
|
{
|
||||||
|
@ -359,8 +276,6 @@ class ClassLoader
|
||||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||||
*
|
*
|
||||||
* @param string|null $apcuPrefix
|
* @param string|null $apcuPrefix
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function setApcuPrefix($apcuPrefix)
|
public function setApcuPrefix($apcuPrefix)
|
||||||
{
|
{
|
||||||
|
@ -381,55 +296,33 @@ class ClassLoader
|
||||||
* Registers this instance as an autoloader.
|
* Registers this instance as an autoloader.
|
||||||
*
|
*
|
||||||
* @param bool $prepend Whether to prepend the autoloader or not
|
* @param bool $prepend Whether to prepend the autoloader or not
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function register($prepend = false)
|
public function register($prepend = false)
|
||||||
{
|
{
|
||||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||||
|
|
||||||
if (null === $this->vendorDir) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($prepend) {
|
|
||||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
|
||||||
} else {
|
|
||||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
|
||||||
self::$registeredLoaders[$this->vendorDir] = $this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unregisters this instance as an autoloader.
|
* Unregisters this instance as an autoloader.
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function unregister()
|
public function unregister()
|
||||||
{
|
{
|
||||||
spl_autoload_unregister(array($this, 'loadClass'));
|
spl_autoload_unregister(array($this, 'loadClass'));
|
||||||
|
|
||||||
if (null !== $this->vendorDir) {
|
|
||||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the given class or interface.
|
* Loads the given class or interface.
|
||||||
*
|
*
|
||||||
* @param string $class The name of the class
|
* @param string $class The name of the class
|
||||||
* @return true|null True if loaded, null otherwise
|
* @return bool|null True if loaded, null otherwise
|
||||||
*/
|
*/
|
||||||
public function loadClass($class)
|
public function loadClass($class)
|
||||||
{
|
{
|
||||||
if ($file = $this->findFile($class)) {
|
if ($file = $this->findFile($class)) {
|
||||||
$includeFile = self::$includeFile;
|
includeFile($file);
|
||||||
$includeFile($file);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -474,21 +367,6 @@ class ClassLoader
|
||||||
return $file;
|
return $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
|
||||||
*
|
|
||||||
* @return array<string, self>
|
|
||||||
*/
|
|
||||||
public static function getRegisteredLoaders()
|
|
||||||
{
|
|
||||||
return self::$registeredLoaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $class
|
|
||||||
* @param string $ext
|
|
||||||
* @return string|false
|
|
||||||
*/
|
|
||||||
private function findFileWithExtension($class, $ext)
|
private function findFileWithExtension($class, $ext)
|
||||||
{
|
{
|
||||||
// PSR-4 lookup
|
// PSR-4 lookup
|
||||||
|
@ -554,26 +432,14 @@ class ClassLoader
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return void
|
/**
|
||||||
*/
|
* Scope isolated include.
|
||||||
private static function initializeIncludeClosure()
|
*
|
||||||
{
|
* Prevents access to $this/self from included files.
|
||||||
if (self::$includeFile !== null) {
|
*/
|
||||||
return;
|
function includeFile($file)
|
||||||
}
|
{
|
||||||
|
include $file;
|
||||||
/**
|
|
||||||
* Scope isolated include.
|
|
||||||
*
|
|
||||||
* Prevents access to $this/self from included files.
|
|
||||||
*
|
|
||||||
* @param string $file
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
self::$includeFile = \Closure::bind(static function($file) {
|
|
||||||
include $file;
|
|
||||||
}, null, null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
359
phpmailer/vendor/composer/InstalledVersions.php
vendored
359
phpmailer/vendor/composer/InstalledVersions.php
vendored
|
@ -1,359 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Composer.
|
|
||||||
*
|
|
||||||
* (c) Nils Adermann <naderman@naderman.de>
|
|
||||||
* Jordi Boggiano <j.boggiano@seld.be>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Composer;
|
|
||||||
|
|
||||||
use Composer\Autoload\ClassLoader;
|
|
||||||
use Composer\Semver\VersionParser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class is copied in every Composer installed project and available to all
|
|
||||||
*
|
|
||||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
|
||||||
*
|
|
||||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
|
||||||
*
|
|
||||||
* @final
|
|
||||||
*/
|
|
||||||
class InstalledVersions
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var mixed[]|null
|
|
||||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
|
||||||
*/
|
|
||||||
private static $installed;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool|null
|
|
||||||
*/
|
|
||||||
private static $canGetVendors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array[]
|
|
||||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
|
||||||
*/
|
|
||||||
private static $installedByVendor = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
|
||||||
*
|
|
||||||
* @return string[]
|
|
||||||
* @psalm-return list<string>
|
|
||||||
*/
|
|
||||||
public static function getInstalledPackages()
|
|
||||||
{
|
|
||||||
$packages = array();
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
$packages[] = array_keys($installed['versions']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (1 === \count($packages)) {
|
|
||||||
return $packages[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a list of all package names with a specific type e.g. 'library'
|
|
||||||
*
|
|
||||||
* @param string $type
|
|
||||||
* @return string[]
|
|
||||||
* @psalm-return list<string>
|
|
||||||
*/
|
|
||||||
public static function getInstalledPackagesByType($type)
|
|
||||||
{
|
|
||||||
$packagesByType = array();
|
|
||||||
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
foreach ($installed['versions'] as $name => $package) {
|
|
||||||
if (isset($package['type']) && $package['type'] === $type) {
|
|
||||||
$packagesByType[] = $name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $packagesByType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks whether the given package is installed
|
|
||||||
*
|
|
||||||
* This also returns true if the package name is provided or replaced by another package
|
|
||||||
*
|
|
||||||
* @param string $packageName
|
|
||||||
* @param bool $includeDevRequirements
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
|
||||||
{
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
if (isset($installed['versions'][$packageName])) {
|
|
||||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks whether the given package satisfies a version constraint
|
|
||||||
*
|
|
||||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
|
||||||
*
|
|
||||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
|
||||||
*
|
|
||||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
|
||||||
* @param string $packageName
|
|
||||||
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
|
||||||
{
|
|
||||||
$constraint = $parser->parseConstraints((string) $constraint);
|
|
||||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
|
||||||
|
|
||||||
return $provided->matches($constraint);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
|
||||||
*
|
|
||||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
|
||||||
* whether a given version of a package is installed, and not just whether it exists
|
|
||||||
*
|
|
||||||
* @param string $packageName
|
|
||||||
* @return string Version constraint usable with composer/semver
|
|
||||||
*/
|
|
||||||
public static function getVersionRanges($packageName)
|
|
||||||
{
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
if (!isset($installed['versions'][$packageName])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$ranges = array();
|
|
||||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
|
||||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
|
||||||
}
|
|
||||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
|
||||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
|
||||||
}
|
|
||||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
|
||||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
|
||||||
}
|
|
||||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
|
||||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return implode(' || ', $ranges);
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $packageName
|
|
||||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
|
||||||
*/
|
|
||||||
public static function getVersion($packageName)
|
|
||||||
{
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
if (!isset($installed['versions'][$packageName])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $installed['versions'][$packageName]['version'];
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $packageName
|
|
||||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
|
||||||
*/
|
|
||||||
public static function getPrettyVersion($packageName)
|
|
||||||
{
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
if (!isset($installed['versions'][$packageName])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $installed['versions'][$packageName]['pretty_version'];
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $packageName
|
|
||||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
|
||||||
*/
|
|
||||||
public static function getReference($packageName)
|
|
||||||
{
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
if (!isset($installed['versions'][$packageName])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $installed['versions'][$packageName]['reference'];
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $packageName
|
|
||||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
|
||||||
*/
|
|
||||||
public static function getInstallPath($packageName)
|
|
||||||
{
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
if (!isset($installed['versions'][$packageName])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
|
||||||
*/
|
|
||||||
public static function getRootPackage()
|
|
||||||
{
|
|
||||||
$installed = self::getInstalled();
|
|
||||||
|
|
||||||
return $installed[0]['root'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the raw installed.php data for custom implementations
|
|
||||||
*
|
|
||||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
|
||||||
* @return array[]
|
|
||||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
|
||||||
*/
|
|
||||||
public static function getRawData()
|
|
||||||
{
|
|
||||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
if (null === self::$installed) {
|
|
||||||
// only require the installed.php file if this file is loaded from its dumped location,
|
|
||||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
|
||||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
|
||||||
self::$installed = include __DIR__ . '/installed.php';
|
|
||||||
} else {
|
|
||||||
self::$installed = array();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return self::$installed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
|
||||||
*
|
|
||||||
* @return array[]
|
|
||||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
|
||||||
*/
|
|
||||||
public static function getAllRawData()
|
|
||||||
{
|
|
||||||
return self::getInstalled();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets you reload the static array from another file
|
|
||||||
*
|
|
||||||
* This is only useful for complex integrations in which a project needs to use
|
|
||||||
* this class but then also needs to execute another project's autoloader in process,
|
|
||||||
* and wants to ensure both projects have access to their version of installed.php.
|
|
||||||
*
|
|
||||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
|
||||||
* the data it needs from this class, then call reload() with
|
|
||||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
|
||||||
* the project in which it runs can then also use this class safely, without
|
|
||||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
|
||||||
*
|
|
||||||
* @param array[] $data A vendor/composer/installed.php data set
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
|
||||||
*/
|
|
||||||
public static function reload($data)
|
|
||||||
{
|
|
||||||
self::$installed = $data;
|
|
||||||
self::$installedByVendor = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array[]
|
|
||||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
|
||||||
*/
|
|
||||||
private static function getInstalled()
|
|
||||||
{
|
|
||||||
if (null === self::$canGetVendors) {
|
|
||||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
|
||||||
}
|
|
||||||
|
|
||||||
$installed = array();
|
|
||||||
|
|
||||||
if (self::$canGetVendors) {
|
|
||||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
|
||||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
|
||||||
$installed[] = self::$installedByVendor[$vendorDir];
|
|
||||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
|
||||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
|
||||||
$required = require $vendorDir.'/composer/installed.php';
|
|
||||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
|
||||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
|
||||||
self::$installed = $installed[count($installed) - 1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === self::$installed) {
|
|
||||||
// only require the installed.php file if this file is loaded from its dumped location,
|
|
||||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
|
||||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
|
||||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
|
||||||
$required = require __DIR__ . '/installed.php';
|
|
||||||
self::$installed = $required;
|
|
||||||
} else {
|
|
||||||
self::$installed = array();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self::$installed !== array()) {
|
|
||||||
$installed[] = self::$installed;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $installed;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,11 +2,10 @@
|
||||||
|
|
||||||
// autoload_classmap.php @generated by Composer
|
// autoload_classmap.php @generated by Composer
|
||||||
|
|
||||||
$vendorDir = dirname(__DIR__);
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
|
||||||
'PHPMailer\\PHPMailer\\DSNConfigurator' => $vendorDir . '/phpmailer/phpmailer/src/DSNConfigurator.php',
|
'PHPMailer\\PHPMailer\\DSNConfigurator' => $vendorDir . '/phpmailer/phpmailer/src/DSNConfigurator.php',
|
||||||
'PHPMailer\\PHPMailer\\Exception' => $vendorDir . '/phpmailer/phpmailer/src/Exception.php',
|
'PHPMailer\\PHPMailer\\Exception' => $vendorDir . '/phpmailer/phpmailer/src/Exception.php',
|
||||||
'PHPMailer\\PHPMailer\\OAuth' => $vendorDir . '/phpmailer/phpmailer/src/OAuth.php',
|
'PHPMailer\\PHPMailer\\OAuth' => $vendorDir . '/phpmailer/phpmailer/src/OAuth.php',
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
// autoload_namespaces.php @generated by Composer
|
// autoload_namespaces.php @generated by Composer
|
||||||
|
|
||||||
$vendorDir = dirname(__DIR__);
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|
2
phpmailer/vendor/composer/autoload_psr4.php
vendored
2
phpmailer/vendor/composer/autoload_psr4.php
vendored
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
// autoload_psr4.php @generated by Composer
|
// autoload_psr4.php @generated by Composer
|
||||||
|
|
||||||
$vendorDir = dirname(__DIR__);
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|
27
phpmailer/vendor/composer/autoload_real.php
vendored
27
phpmailer/vendor/composer/autoload_real.php
vendored
|
@ -22,14 +22,31 @@ class ComposerAutoloaderInitPhpMailerAddon
|
||||||
return self::$loader;
|
return self::$loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
require __DIR__ . '/platform_check.php';
|
|
||||||
|
|
||||||
spl_autoload_register(array('ComposerAutoloaderInitPhpMailerAddon', 'loadClassLoader'), true, true);
|
spl_autoload_register(array('ComposerAutoloaderInitPhpMailerAddon', 'loadClassLoader'), true, true);
|
||||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||||
spl_autoload_unregister(array('ComposerAutoloaderInitPhpMailerAddon', 'loadClassLoader'));
|
spl_autoload_unregister(array('ComposerAutoloaderInitPhpMailerAddon', 'loadClassLoader'));
|
||||||
|
|
||||||
require __DIR__ . '/autoload_static.php';
|
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||||
call_user_func(\Composer\Autoload\ComposerStaticInitPhpMailerAddon::getInitializer($loader));
|
if ($useStaticLoader) {
|
||||||
|
require_once __DIR__ . '/autoload_static.php';
|
||||||
|
|
||||||
|
call_user_func(\Composer\Autoload\ComposerStaticInitPhpMailerAddon::getInitializer($loader));
|
||||||
|
} else {
|
||||||
|
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||||
|
foreach ($map as $namespace => $path) {
|
||||||
|
$loader->set($namespace, $path);
|
||||||
|
}
|
||||||
|
|
||||||
|
$map = require __DIR__ . '/autoload_psr4.php';
|
||||||
|
foreach ($map as $namespace => $path) {
|
||||||
|
$loader->setPsr4($namespace, $path);
|
||||||
|
}
|
||||||
|
|
||||||
|
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||||
|
if ($classMap) {
|
||||||
|
$loader->addClassMap($classMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ class ComposerStaticInitPhpMailerAddon
|
||||||
);
|
);
|
||||||
|
|
||||||
public static $classMap = array (
|
public static $classMap = array (
|
||||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
|
||||||
'PHPMailer\\PHPMailer\\DSNConfigurator' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/DSNConfigurator.php',
|
'PHPMailer\\PHPMailer\\DSNConfigurator' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/DSNConfigurator.php',
|
||||||
'PHPMailer\\PHPMailer\\Exception' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/Exception.php',
|
'PHPMailer\\PHPMailer\\Exception' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/Exception.php',
|
||||||
'PHPMailer\\PHPMailer\\OAuth' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/OAuth.php',
|
'PHPMailer\\PHPMailer\\OAuth' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/OAuth.php',
|
||||||
|
|
169
phpmailer/vendor/composer/installed.json
vendored
169
phpmailer/vendor/composer/installed.json
vendored
|
@ -1,90 +1,81 @@
|
||||||
{
|
[
|
||||||
"packages": [
|
{
|
||||||
{
|
"name": "phpmailer/phpmailer",
|
||||||
"name": "phpmailer/phpmailer",
|
"version": "v6.9.1",
|
||||||
"version": "v6.10.0",
|
"version_normalized": "6.9.1.0",
|
||||||
"version_normalized": "6.10.0.0",
|
"source": {
|
||||||
"source": {
|
"type": "git",
|
||||||
"type": "git",
|
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
"reference": "039de174cd9c17a8389754d3b877a2ed22743e18"
|
||||||
"reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144"
|
},
|
||||||
},
|
"dist": {
|
||||||
"dist": {
|
"type": "zip",
|
||||||
"type": "zip",
|
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18",
|
||||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144",
|
"reference": "039de174cd9c17a8389754d3b877a2ed22743e18",
|
||||||
"reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144",
|
"shasum": ""
|
||||||
"shasum": ""
|
},
|
||||||
},
|
"require": {
|
||||||
"require": {
|
"ext-ctype": "*",
|
||||||
"ext-ctype": "*",
|
"ext-filter": "*",
|
||||||
"ext-filter": "*",
|
"ext-hash": "*",
|
||||||
"ext-hash": "*",
|
"php": ">=5.5.0"
|
||||||
"php": ">=5.5.0"
|
},
|
||||||
},
|
"require-dev": {
|
||||||
"require-dev": {
|
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
|
"doctrine/annotations": "^1.2.6 || ^1.13.3",
|
||||||
"doctrine/annotations": "^1.2.6 || ^1.13.3",
|
"php-parallel-lint/php-console-highlighter": "^1.0.0",
|
||||||
"php-parallel-lint/php-console-highlighter": "^1.0.0",
|
"php-parallel-lint/php-parallel-lint": "^1.3.2",
|
||||||
"php-parallel-lint/php-parallel-lint": "^1.3.2",
|
"phpcompatibility/php-compatibility": "^9.3.5",
|
||||||
"phpcompatibility/php-compatibility": "^9.3.5",
|
"roave/security-advisories": "dev-latest",
|
||||||
"roave/security-advisories": "dev-latest",
|
"squizlabs/php_codesniffer": "^3.7.2",
|
||||||
"squizlabs/php_codesniffer": "^3.7.2",
|
"yoast/phpunit-polyfills": "^1.0.4"
|
||||||
"yoast/phpunit-polyfills": "^1.0.4"
|
},
|
||||||
},
|
"suggest": {
|
||||||
"suggest": {
|
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
|
||||||
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
|
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
|
||||||
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
|
"ext-openssl": "Needed for secure SMTP sending and DKIM signing",
|
||||||
"ext-openssl": "Needed for secure SMTP sending and DKIM signing",
|
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
|
||||||
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
|
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
|
||||||
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
|
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
|
||||||
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
|
"psr/log": "For optional PSR-3 debug logging",
|
||||||
"psr/log": "For optional PSR-3 debug logging",
|
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
|
||||||
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
|
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication"
|
||||||
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication"
|
},
|
||||||
},
|
"time": "2023-11-25T22:23:28+00:00",
|
||||||
"time": "2025-04-24T15:19:31+00:00",
|
"type": "library",
|
||||||
"type": "library",
|
"installation-source": "dist",
|
||||||
"installation-source": "dist",
|
"autoload": {
|
||||||
"autoload": {
|
"psr-4": {
|
||||||
"psr-4": {
|
"PHPMailer\\PHPMailer\\": "src/"
|
||||||
"PHPMailer\\PHPMailer\\": "src/"
|
}
|
||||||
}
|
},
|
||||||
},
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"license": [
|
||||||
"license": [
|
"LGPL-2.1-only"
|
||||||
"LGPL-2.1-only"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Marcus Bointon",
|
|
||||||
"email": "phpmailer@synchromedia.co.uk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Jim Jagielski",
|
|
||||||
"email": "jimjag@gmail.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Andy Prevost",
|
|
||||||
"email": "codeworxtech@users.sourceforge.net"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Brent R. Matzelle"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
|
||||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.10.0"
|
|
||||||
},
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://github.com/Synchro",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"install-path": "../phpmailer/phpmailer"
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"dev": true,
|
"authors": [
|
||||||
"dev-package-names": []
|
{
|
||||||
}
|
"name": "Marcus Bointon",
|
||||||
|
"email": "phpmailer@synchromedia.co.uk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jim Jagielski",
|
||||||
|
"email": "jimjag@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Andy Prevost",
|
||||||
|
"email": "codeworxtech@users.sourceforge.net"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Brent R. Matzelle"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/Synchro",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
32
phpmailer/vendor/composer/installed.php
vendored
32
phpmailer/vendor/composer/installed.php
vendored
|
@ -1,32 +0,0 @@
|
||||||
<?php return array(
|
|
||||||
'root' => array(
|
|
||||||
'name' => 'friendica-addons/phpmailer',
|
|
||||||
'pretty_version' => 'dev-2025.07-rc',
|
|
||||||
'version' => 'dev-2025.07-rc',
|
|
||||||
'reference' => '715f70032330ad14f710284104c8593c7800e125',
|
|
||||||
'type' => 'friendica-addon',
|
|
||||||
'install_path' => __DIR__ . '/../../',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev' => true,
|
|
||||||
),
|
|
||||||
'versions' => array(
|
|
||||||
'friendica-addons/phpmailer' => array(
|
|
||||||
'pretty_version' => 'dev-2025.07-rc',
|
|
||||||
'version' => 'dev-2025.07-rc',
|
|
||||||
'reference' => '715f70032330ad14f710284104c8593c7800e125',
|
|
||||||
'type' => 'friendica-addon',
|
|
||||||
'install_path' => __DIR__ . '/../../',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev_requirement' => false,
|
|
||||||
),
|
|
||||||
'phpmailer/phpmailer' => array(
|
|
||||||
'pretty_version' => 'v6.10.0',
|
|
||||||
'version' => '6.10.0.0',
|
|
||||||
'reference' => 'bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144',
|
|
||||||
'type' => 'library',
|
|
||||||
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev_requirement' => false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
26
phpmailer/vendor/composer/platform_check.php
vendored
26
phpmailer/vendor/composer/platform_check.php
vendored
|
@ -1,26 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
// platform_check.php @generated by Composer
|
|
||||||
|
|
||||||
$issues = array();
|
|
||||||
|
|
||||||
if (!(PHP_VERSION_ID >= 70000)) {
|
|
||||||
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($issues) {
|
|
||||||
if (!headers_sent()) {
|
|
||||||
header('HTTP/1.1 500 Internal Server Error');
|
|
||||||
}
|
|
||||||
if (!ini_get('display_errors')) {
|
|
||||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
|
||||||
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
|
||||||
} elseif (!headers_sent()) {
|
|
||||||
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
trigger_error(
|
|
||||||
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
|
||||||
E_USER_ERROR
|
|
||||||
);
|
|
||||||
}
|
|
15
phpmailer/vendor/phpmailer/phpmailer/.editorconfig
vendored
Normal file
15
phpmailer/vendor/phpmailer/phpmailer/.editorconfig
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.{yml,yaml}]
|
||||||
|
indent_size = 2
|
27
phpmailer/vendor/phpmailer/phpmailer/README.md
vendored
27
phpmailer/vendor/phpmailer/phpmailer/README.md
vendored
|
@ -20,35 +20,34 @@
|
||||||
- Multipart/alternative emails for mail clients that do not read HTML email
|
- Multipart/alternative emails for mail clients that do not read HTML email
|
||||||
- Add attachments, including inline
|
- Add attachments, including inline
|
||||||
- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
|
- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
|
||||||
- Full UTF-8 support when using servers that support `SMTPUTF8`.
|
- SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SMTPS and SMTP+STARTTLS transports
|
||||||
- Support for iCal events in multiparts and attachments
|
|
||||||
- SMTP authentication with `LOGIN`, `PLAIN`, `CRAM-MD5`, and `XOAUTH2` mechanisms over SMTPS and SMTP+STARTTLS transports
|
|
||||||
- Validates email addresses automatically
|
- Validates email addresses automatically
|
||||||
- Protects against header injection attacks
|
- Protects against header injection attacks
|
||||||
- Error messages in over 50 languages!
|
- Error messages in over 50 languages!
|
||||||
- DKIM and S/MIME signing support
|
- DKIM and S/MIME signing support
|
||||||
- Compatible with PHP 5.5 and later, including PHP 8.4
|
- Compatible with PHP 5.5 and later, including PHP 8.2
|
||||||
- Namespaced to prevent name clashes
|
- Namespaced to prevent name clashes
|
||||||
- Much more!
|
- Much more!
|
||||||
|
|
||||||
## Why you might need it
|
## Why you might need it
|
||||||
Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as authentication, HTML messages, and attachments.
|
Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments.
|
||||||
|
|
||||||
Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe!
|
Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe!
|
||||||
|
|
||||||
The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost.
|
The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost.
|
||||||
|
|
||||||
*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that
|
*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that
|
||||||
you should look at before rolling your own. Try [Symfony Mailer](https://symfony.com/doc/current/mailer.html), [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc.
|
you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/)
|
||||||
|
, [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
This software is distributed under the [LGPL 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution.
|
This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution.
|
||||||
|
|
||||||
## Installation & loading
|
## Installation & loading
|
||||||
PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file:
|
PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
"phpmailer/phpmailer": "^6.10.0"
|
"phpmailer/phpmailer": "^6.9.1"
|
||||||
```
|
```
|
||||||
|
|
||||||
or run
|
or run
|
||||||
|
@ -75,7 +74,7 @@ require 'path/to/PHPMailer/src/PHPMailer.php';
|
||||||
require 'path/to/PHPMailer/src/SMTP.php';
|
require 'path/to/PHPMailer/src/SMTP.php';
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for it. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally.
|
If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for the SMTP class. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally.
|
||||||
|
|
||||||
## Legacy versions
|
## Legacy versions
|
||||||
PHPMailer 5.2 (which is compatible with PHP 5.0 — 7.0) is no longer supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases.
|
PHPMailer 5.2 (which is compatible with PHP 5.0 — 7.0) is no longer supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases.
|
||||||
|
@ -96,7 +95,7 @@ use PHPMailer\PHPMailer\PHPMailer;
|
||||||
use PHPMailer\PHPMailer\SMTP;
|
use PHPMailer\PHPMailer\SMTP;
|
||||||
use PHPMailer\PHPMailer\Exception;
|
use PHPMailer\PHPMailer\Exception;
|
||||||
|
|
||||||
//Load Composer's autoloader (created by composer, not included with PHPMailer)
|
//Load Composer's autoloader
|
||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
//Create an instance; passing `true` enables exceptions
|
//Create an instance; passing `true` enables exceptions
|
||||||
|
@ -145,7 +144,7 @@ If you are re-using the instance (e.g. when sending to a mailing list), you may
|
||||||
That's it. You should now be ready to use PHPMailer!
|
That's it. You should now be ready to use PHPMailer!
|
||||||
|
|
||||||
## Localization
|
## Localization
|
||||||
PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder, you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this:
|
PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder, you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
//To load the French version
|
//To load the French version
|
||||||
|
@ -163,9 +162,9 @@ To reduce PHPMailer's deployed code footprint, examples are not included if you
|
||||||
|
|
||||||
Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/).
|
Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/).
|
||||||
|
|
||||||
You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](https://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailer/PHPMailerTest.php) a good reference for how to do various operations such as encryption.
|
You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good reference for how to do various operations such as encryption.
|
||||||
|
|
||||||
If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](https://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting).
|
If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting).
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
[PHPMailer tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/) use PHPUnit 9, with [a polyfill](https://github.com/Yoast/PHPUnit-Polyfills) to let 9-style tests run on older PHPUnit and PHP versions.
|
[PHPMailer tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/) use PHPUnit 9, with [a polyfill](https://github.com/Yoast/PHPUnit-Polyfills) to let 9-style tests run on older PHPUnit and PHP versions.
|
||||||
|
@ -214,7 +213,7 @@ use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-php
|
||||||
See [changelog](changelog.md).
|
See [changelog](changelog.md).
|
||||||
|
|
||||||
## History
|
## History
|
||||||
- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](https://sourceforge.net/projects/phpmailer/).
|
- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/).
|
||||||
- [Marcus Bointon](https://github.com/Synchro) (`coolbru` on SF) and Andy Prevost (`codeworxtech`) took over the project in 2004.
|
- [Marcus Bointon](https://github.com/Synchro) (`coolbru` on SF) and Andy Prevost (`codeworxtech`) took over the project in 2004.
|
||||||
- Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski.
|
- Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski.
|
||||||
- Marcus created [his fork on GitHub](https://github.com/Synchro/PHPMailer) in 2008.
|
- Marcus created [his fork on GitHub](https://github.com/Synchro/PHPMailer) in 2008.
|
||||||
|
|
|
@ -13,13 +13,13 @@ PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs
|
||||||
|
|
||||||
PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr.
|
PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr.
|
||||||
|
|
||||||
PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it is not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project.
|
PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project.
|
||||||
|
|
||||||
PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity.
|
PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity.
|
||||||
|
|
||||||
PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer).
|
PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer).
|
||||||
|
|
||||||
PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html).
|
PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html).
|
||||||
|
|
||||||
PHPMailer versions prior to 5.2.14 (released November 2015) are vulnerable to [CVE-2015-8476](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8476) an SMTP CRLF injection bug permitting arbitrary message sending.
|
PHPMailer versions prior to 5.2.14 (released November 2015) are vulnerable to [CVE-2015-8476](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8476) an SMTP CRLF injection bug permitting arbitrary message sending.
|
||||||
|
|
||||||
|
|
48
phpmailer/vendor/phpmailer/phpmailer/SMTPUTF8.md
vendored
48
phpmailer/vendor/phpmailer/phpmailer/SMTPUTF8.md
vendored
|
@ -1,48 +0,0 @@
|
||||||
# A short history of UTF-8 in email
|
|
||||||
|
|
||||||
## Background
|
|
||||||
|
|
||||||
For most of its existence, SMTP has been a 7-bit channel, only supporting US-ASCII characters. This has been a problem for many languages, especially those that use non-Latin scripts, and has led to the development of various workarounds.
|
|
||||||
|
|
||||||
The first major improvement, introduced in 1994 in [RFC 1652](https://www.rfc-editor.org/rfc/rfc1652) and extended in 2011 in [RFC 6152](https://www.rfc-editor.org/rfc/rfc6152), was the addition of the `8BITMIME` SMTP extension, which allowed raw 8-bit data to be included in message bodies sent over SMTP.
|
|
||||||
This allowed the message *contents* to contain 8-bit data, including things like UTF-8 text, even though the SMTP protocol itself was still firmly 7-bit. This worked by having the server switch to 8-bit after the headers, and then back to 7-bit after the completion of a `DATA` command.
|
|
||||||
|
|
||||||
From 1996, messages could support [RFC 2047 encoding](https://www.rfc-editor.org/rfc/rfc2047), which permitted inserting characters from any character set into header *values* (but not names), but only by encoding them in somewhat unreadable ways to allow them to survive passage through a 7-bit channel. An example with a subject of "Schrödinger's cat" would be:
|
|
||||||
|
|
||||||
```
|
|
||||||
Subject: =?utf-8?Q=Schr=C3=B6dinger=92s_Cat?=
|
|
||||||
```
|
|
||||||
|
|
||||||
Here the accented `ö` is encoded as `=C3=B6`, which is the UTF-8 encoding of the 2-byte character, and the whole thing is wrapped in `=?utf-8?Q?` to indicate that it uses the UTF-8 charset and `quoted-printable` encoding. This is a bit of a hack, and not very human-friendly, but it works.
|
|
||||||
|
|
||||||
Similarly, 8-bit message bodies could be encoded using the same `quoted-printable` and `base64` content transfer encoding (CTE) schemes, which preserved the 8-bit content while encoding it in a format that could survive transmission through a 7-bit channel.
|
|
||||||
|
|
||||||
Domain names were originally also stuck in a 7-bit world, actually even more constrained to only a subset of the US-ASCII character set. But of course, many people want to have domains in their own language/script. Internationalized domain name (IDN) permitted this, using yet another complex encoding scheme called punycode, defined for domain names in 2003 in [RFC 3492](https://www.rfc-editor.org/rfc/rfc3492). This finally allowed the domain part (after the `@`) of email addresses to contain UTF-8, though it was actually an illusion preserved by email client applications. For example, an address of
|
|
||||||
`user@café.example.com` translates to
|
|
||||||
`user@xn--caf-dma.example.com` in punycode, rendering it mostly unreadable, but 7-bit friendly, and remaining compatible with email clients that don't know about IDN.
|
|
||||||
|
|
||||||
The one remaining part of email that could not handle UTF-8 is the local part of email addresses (the part before the `@`).
|
|
||||||
|
|
||||||
I've only mentioned UTF-8 here, but most of these approaches also allowed other character sets that were popular, such as [the ISO-8859 family](https://en.wikipedia.org/wiki/ISO/IEC_8859). However, UTF-8 solves so many problems that these other character sets are gradually falling out of favour, as UTF-8 can support all languages.
|
|
||||||
|
|
||||||
This patchwork of overlapping approaches has served us well, but we have to admit that it's a mess.
|
|
||||||
|
|
||||||
## SMTPUTF8
|
|
||||||
|
|
||||||
`SMTPUTF8` is another SMTP extension, defined in [RFC 6531](https://www.rfc-editor.org/rfc/rfc6531) in 2012. This essentially solves the whole problem, allowing the entire SMTP conversation — commands, headers, and message bodies — to be sent in raw, unencoded UTF-8.
|
|
||||||
|
|
||||||
But there's a problem with this approach: adoption. If you send a UTF-8 message to a recipient whose mail server doesn't support this format, the sender has to somehow downgrade the message to make it survive a transition to 7-bit. This is a hard problem to solve, especially since there is no way to make a 7-bit system support UTF-8 in the local parts of addresses. This downgrade problem is what held up the adoption of `SMTPUTF8` in PHPMailer for many years, but in that time the *de facto* approach has become to simply fail in that situation, and tell the recipient it's time they upgraded their mail server 😅.
|
|
||||||
|
|
||||||
The vast majority of large email providers (gmail, Yahoo, Microsoft, etc), mail servers (postfix, exim, IIS, etc), and mail clients (Apple Mail, Outlook, Thunderbird, etc) now all support SMTPUTF8, so the need for backward compatibility is no longer what it was.
|
|
||||||
|
|
||||||
## SMTPUTF8 in PHPMailer
|
|
||||||
|
|
||||||
Several other PHP email libraries have implemented a halfway solution to `SMTPUTF8`, adding only the ability to support UTF-8 in email addresses, not elsewhere in the protocol. I wanted PHPMailer to do it "the right way", and this has taken much longer. PHPMailer now supports UTF-8 everywhere, and does not need to use transfer or header encodings for UTF-8 text when connecting to an `SMTPUTF8`-capable mail server.
|
|
||||||
|
|
||||||
This support is handled automatically: if you add an email address that requires UTF-8, PHPMailer will use UTF-8 for everything. If not, it will fall back to 7-bit and encode the message as necessary.
|
|
||||||
|
|
||||||
The one place you will need to be careful is in the selection of the address validator. By default, PHPMailer uses PHP's built-in `filter_var` validator, which does not allow UTF-8 email addresses. When PHPMailer spots that you have submitted a UTF-8 address, but have not altered the default validator, it will automatically switch to using a UTF-8-compatible validator. As soon as you do this, any SMTP connection you make will *require* that the server you connect to supports `SMTPUTF8`. You can select this validator explicitly by setting `PHPMailer::$validator = 'eai'` (an acronym for Email Address Internationalization).
|
|
||||||
|
|
||||||
### Postfix gotcha
|
|
||||||
|
|
||||||
Postfix has supported `SMTPUTF8` for a long time, but it has a peculiarity that it does not always advertise that it does so. However, rather surprisingly, if you use UTF-8 in the conversation, it will work anyway.
|
|
2
phpmailer/vendor/phpmailer/phpmailer/VERSION
vendored
2
phpmailer/vendor/phpmailer/phpmailer/VERSION
vendored
|
@ -1 +1 @@
|
||||||
6.10.0
|
6.9.1
|
||||||
|
|
|
@ -28,8 +28,7 @@
|
||||||
"config": {
|
"config": {
|
||||||
"allow-plugins": {
|
"allow-plugins": {
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": true
|
"dealerdirect/phpcodesniffer-composer-installer": true
|
||||||
},
|
}
|
||||||
"lock": false
|
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.0",
|
"php": ">=5.5.0",
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
* @copyright 2012 - 2020 Marcus Bointon
|
* @copyright 2012 - 2020 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
@ -36,7 +36,7 @@ namespace PHPMailer\PHPMailer;
|
||||||
* Aliases for League Provider Classes
|
* Aliases for League Provider Classes
|
||||||
* Make sure you have added these to your composer.json and run `composer install`
|
* Make sure you have added these to your composer.json and run `composer install`
|
||||||
* Plenty to choose from here:
|
* Plenty to choose from here:
|
||||||
* @see https://oauth2-client.thephpleague.com/providers/thirdparty/
|
* @see http://oauth2-client.thephpleague.com/providers/thirdparty/
|
||||||
*/
|
*/
|
||||||
//@see https://github.com/thephpleague/oauth2-google
|
//@see https://github.com/thephpleague/oauth2-google
|
||||||
use League\OAuth2\Client\Provider\Google;
|
use League\OAuth2\Client\Provider\Google;
|
||||||
|
@ -178,5 +178,5 @@ if (!isset($_GET['code'])) {
|
||||||
);
|
);
|
||||||
//Use this to interact with an API on the users behalf
|
//Use this to interact with an API on the users behalf
|
||||||
//Use this to get a new access token if the old one expires
|
//Use this to get a new access token if the old one expires
|
||||||
echo 'Refresh Token: ', htmlspecialchars($token->getRefreshToken());
|
echo 'Refresh Token: ', $token->getRefreshToken();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,32 +5,27 @@
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @author Matt Sturdy <matt.sturdy@gmail.com>
|
* @author Matt Sturdy <matt.sturdy@gmail.com>
|
||||||
* @author Crystopher Glodzienski Cardoso <crystopher.glodzienski@gmail.com>
|
* @author Crystopher Glodzienski Cardoso <crystopher.glodzienski@gmail.com>
|
||||||
* @author Daniel Cruz <danicruz0415@gmail.com>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.';
|
$PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.';
|
||||||
$PHPMAILER_LANG['buggy_php'] = 'Tu versión de PHP está afectada por un bug que puede resultar en mensajes corruptos. Para arreglarlo, cambia a enviar usando SMTP, deshabilita la opción mail.add_x_header en tu php.ini, cambia a MacOS o Linux, o actualiza tu PHP a la versión 7.0.17+ o 7.1.3+.';
|
|
||||||
$PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.';
|
$PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.';
|
||||||
$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.';
|
$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.';
|
||||||
$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.';
|
$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.';
|
||||||
$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: ';
|
$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: ';
|
||||||
$PHPMAILER_LANG['execute'] = 'Imposible ejecutar: ';
|
$PHPMAILER_LANG['execute'] = 'Imposible ejecutar: ';
|
||||||
$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: ';
|
|
||||||
$PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: ';
|
$PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: ';
|
||||||
$PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: ';
|
$PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: ';
|
||||||
$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
|
$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
|
||||||
$PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.';
|
$PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.';
|
||||||
$PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: ';
|
$PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: ';
|
||||||
$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido';
|
|
||||||
$PHPMAILER_LANG['invalid_hostentry'] = 'Hostentry inválido: ';
|
|
||||||
$PHPMAILER_LANG['invalid_host'] = 'Host inválido: ';
|
|
||||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.';
|
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.';
|
||||||
$PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.';
|
$PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.';
|
||||||
$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: ';
|
$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: ';
|
||||||
$PHPMAILER_LANG['signing'] = 'Error al firmar: ';
|
$PHPMAILER_LANG['signing'] = 'Error al firmar: ';
|
||||||
$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: ';
|
|
||||||
$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: ';
|
|
||||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.';
|
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.';
|
||||||
$PHPMAILER_LANG['smtp_detail'] = 'Detalle: ';
|
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: ';
|
$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: ';
|
||||||
$PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: ';
|
$PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: ';
|
||||||
|
$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: ';
|
||||||
|
$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: ';
|
||||||
|
$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: ';
|
||||||
|
$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido';
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
* Some French punctuation requires a thin non-breaking space (U+202F) character before it,
|
* Some French punctuation requires a thin non-breaking space (U+202F) character before it,
|
||||||
* for example before a colon or exclamation mark.
|
* for example before a colon or exclamation mark.
|
||||||
* There is one of these characters between these quotes: " "
|
* There is one of these characters between these quotes: " "
|
||||||
|
* @see http://unicode.org/udhr/n/notes_fra.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l’authentification.';
|
$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l’authentification.';
|
||||||
|
@ -30,7 +31,7 @@ $PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : les destinataires s
|
||||||
$PHPMAILER_LANG['signing'] = 'Erreur de signature : ';
|
$PHPMAILER_LANG['signing'] = 'Erreur de signature : ';
|
||||||
$PHPMAILER_LANG['smtp_code'] = 'Code SMTP : ';
|
$PHPMAILER_LANG['smtp_code'] = 'Code SMTP : ';
|
||||||
$PHPMAILER_LANG['smtp_code_ex'] = 'Informations supplémentaires SMTP : ';
|
$PHPMAILER_LANG['smtp_code_ex'] = 'Informations supplémentaires SMTP : ';
|
||||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échoué.';
|
$PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échouée.';
|
||||||
$PHPMAILER_LANG['smtp_detail'] = 'Détails : ';
|
$PHPMAILER_LANG['smtp_detail'] = 'Détails : ';
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP : ';
|
$PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP : ';
|
||||||
$PHPMAILER_LANG['variable_set'] = 'Impossible d’initialiser ou de réinitialiser une variable : ';
|
$PHPMAILER_LANG['variable_set'] = 'Impossible d’initialiser ou de réinitialiser une variable : ';
|
||||||
|
|
|
@ -3,35 +3,27 @@
|
||||||
/**
|
/**
|
||||||
* Japanese PHPMailer language file: refer to English translation for definitive list
|
* Japanese PHPMailer language file: refer to English translation for definitive list
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @author Mitsuhiro Yoshida <https://mitstek.com>
|
* @author Mitsuhiro Yoshida <http://mitstek.com/>
|
||||||
* @author Yoshi Sakai <http://bluemooninc.jp/>
|
* @author Yoshi Sakai <http://bluemooninc.jp/>
|
||||||
* @author Arisophy <https://github.com/arisophy/>
|
* @author Arisophy <https://github.com/arisophy/>
|
||||||
* @author ARAKI Musashi <https://github.com/arakim/>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。';
|
$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。';
|
||||||
$PHPMAILER_LANG['buggy_php'] = 'ご利用のバージョンのPHPには不具合があり、メッセージが破損するおそれがあります。問題の解決は以下のいずれかを行ってください。SMTPでの送信に切り替える。php.iniのmail.add_x_headerをoffにする。MacOSまたはLinuxに切り替える。PHPバージョン7.0.17以降または7.1.3以降にアップグレードする。';
|
|
||||||
$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。';
|
$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。';
|
||||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。';
|
$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。';
|
||||||
$PHPMAILER_LANG['empty_message'] = 'メール本文が空です。';
|
$PHPMAILER_LANG['empty_message'] = 'メール本文が空です。';
|
||||||
$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: ';
|
$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: ';
|
||||||
$PHPMAILER_LANG['execute'] = '実行できませんでした: ';
|
$PHPMAILER_LANG['execute'] = '実行できませんでした: ';
|
||||||
$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: ';
|
|
||||||
$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: ';
|
$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: ';
|
||||||
$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: ';
|
$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: ';
|
||||||
$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: ';
|
$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: ';
|
||||||
$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。';
|
$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。';
|
||||||
$PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: ';
|
$PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: ';
|
||||||
$PHPMAILER_LANG['invalid_header'] = '不正なヘッダー名またはその内容';
|
|
||||||
$PHPMAILER_LANG['invalid_hostentry'] = '不正なホストエントリー: ';
|
|
||||||
$PHPMAILER_LANG['invalid_host'] = '不正なホスト: ';
|
|
||||||
$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';
|
|
||||||
$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';
|
$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';
|
||||||
|
$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';
|
||||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: ';
|
$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: ';
|
||||||
$PHPMAILER_LANG['signing'] = '署名エラー: ';
|
$PHPMAILER_LANG['signing'] = '署名エラー: ';
|
||||||
$PHPMAILER_LANG['smtp_code'] = 'SMTPコード: ';
|
|
||||||
$PHPMAILER_LANG['smtp_code_ex'] = 'SMTP追加情報: ';
|
|
||||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。';
|
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。';
|
||||||
$PHPMAILER_LANG['smtp_detail'] = '詳細: ';
|
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: ';
|
$PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: ';
|
||||||
$PHPMAILER_LANG['variable_set'] = '変数が存在しません: ';
|
$PHPMAILER_LANG['variable_set'] = '変数が存在しません: ';
|
||||||
|
$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: ';
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Kurdish (Sorani) PHPMailer language file: refer to English translation for definitive list
|
|
||||||
* @package PHPMailer
|
|
||||||
* @author Halo Salman <halo@home4t.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
$PHPMAILER_LANG['authenticate'] = 'هەڵەی SMTP : نەتوانرا کۆدەکە پشتڕاست بکرێتەوە ';
|
|
||||||
$PHPMAILER_LANG['connect_host'] = 'هەڵەی SMTP: نەتوانرا پەیوەندی بە سێرڤەرەوە بکات SMTP.';
|
|
||||||
$PHPMAILER_LANG['data_not_accepted'] = 'هەڵەی SMTP: ئەو زانیاریانە قبوڵ نەکرا.';
|
|
||||||
$PHPMAILER_LANG['empty_message'] = 'پەیامەکە بەتاڵە';
|
|
||||||
$PHPMAILER_LANG['encoding'] = 'کۆدکردنی نەزانراو : ';
|
|
||||||
$PHPMAILER_LANG['execute'] = 'ناتوانرێت جێبەجێ بکرێت: ';
|
|
||||||
$PHPMAILER_LANG['file_access'] = 'ناتوانرێت دەستت بگات بە فایلەکە: ';
|
|
||||||
$PHPMAILER_LANG['file_open'] = 'هەڵەی پەڕگە(فایل): ناتوانرێت بکرێتەوە: ';
|
|
||||||
$PHPMAILER_LANG['from_failed'] = 'هەڵە لە ئاستی ناونیشانی نێرەر: ';
|
|
||||||
$PHPMAILER_LANG['instantiate'] = 'ناتوانرێت خزمەتگوزاری پۆستە پێشکەش بکرێت.';
|
|
||||||
$PHPMAILER_LANG['invalid_address'] = 'نەتوانرا بنێردرێت ، چونکە ناونیشانی ئیمەیڵەکە نادروستە: ';
|
|
||||||
$PHPMAILER_LANG['mailer_not_supported'] = ' مەیلەر پشتگیری ناکات';
|
|
||||||
$PHPMAILER_LANG['provide_address'] = 'دەبێت ناونیشانی ئیمەیڵی لانیکەم یەک وەرگر دابین بکرێت.';
|
|
||||||
$PHPMAILER_LANG['recipients_failed'] = ' هەڵەی SMTP: ئەم هەڵانەی خوارەوەشکستی هێنا لە ناردن بۆ هەردووکیان: ';
|
|
||||||
$PHPMAILER_LANG['signing'] = 'هەڵەی واژۆ: ';
|
|
||||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect()پەیوەندی شکستی هێنا .';
|
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'هەڵەی ئاستی سێرڤەری SMTP: ';
|
|
||||||
$PHPMAILER_LANG['variable_set'] = 'ناتوانرێت بیگۆڕیت یان دوبارە بینێریتەوە: ';
|
|
||||||
$PHPMAILER_LANG['extension_missing'] = 'درێژکراوە نەماوە: ';
|
|
|
@ -3,32 +3,25 @@
|
||||||
/**
|
/**
|
||||||
* Portuguese (European) PHPMailer language file: refer to English translation for definitive list
|
* Portuguese (European) PHPMailer language file: refer to English translation for definitive list
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @author João Vieira <mail@joaovieira.eu>
|
* @author Jonadabe <jonadabe@hotmail.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Falha na autenticação.';
|
$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.';
|
||||||
$PHPMAILER_LANG['buggy_php'] = 'A sua versão do PHP tem um bug que pode causar mensagens corrompidas. Para resolver, utilize o envio por SMTP, desative a opção mail.add_x_header no ficheiro php.ini, mude para MacOS ou Linux, ou atualize o PHP para a versão 7.0.17+ ou 7.1.3+.';
|
$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.';
|
||||||
$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Não foi possível ligar ao servidor SMTP.';
|
$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.';
|
||||||
$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Dados não aceites.';
|
$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.';
|
||||||
$PHPMAILER_LANG['empty_message'] = 'A mensagem de e-mail está vazia.';
|
|
||||||
$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
|
$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
|
||||||
$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
|
$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
|
||||||
$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: ';
|
$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: ';
|
||||||
$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder ao ficheiro: ';
|
$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: ';
|
||||||
$PHPMAILER_LANG['file_open'] = 'Erro ao abrir o ficheiro: ';
|
$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: ';
|
||||||
$PHPMAILER_LANG['from_failed'] = 'O envio falhou para o seguinte endereço do remetente: ';
|
$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.';
|
||||||
$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.';
|
$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: ';
|
||||||
$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: ';
|
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
|
||||||
$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor do cabeçalho inválido.';
|
$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.';
|
||||||
$PHPMAILER_LANG['invalid_hostentry'] = 'Entrada de host inválida: ';
|
$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: ';
|
||||||
$PHPMAILER_LANG['invalid_host'] = 'Host inválido: ';
|
|
||||||
$PHPMAILER_LANG['mailer_not_supported'] = 'O cliente de e-mail não é suportado.';
|
|
||||||
$PHPMAILER_LANG['provide_address'] = 'Deve fornecer pelo menos um endereço de destinatário.';
|
|
||||||
$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Falha no envio para os seguintes destinatários: ';
|
|
||||||
$PHPMAILER_LANG['signing'] = 'Erro ao assinar: ';
|
$PHPMAILER_LANG['signing'] = 'Erro ao assinar: ';
|
||||||
$PHPMAILER_LANG['smtp_code'] = 'Código SMTP: ';
|
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.';
|
||||||
$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais SMTP: ';
|
$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: ';
|
||||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Falha na função SMTP connect().';
|
|
||||||
$PHPMAILER_LANG['smtp_detail'] = 'Detalhes: ';
|
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: ';
|
|
||||||
$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';
|
$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';
|
||||||
|
$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: ';
|
||||||
|
|
|
@ -5,32 +5,24 @@
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @author Alexey Chumakov <alex@chumakov.ru>
|
* @author Alexey Chumakov <alex@chumakov.ru>
|
||||||
* @author Foster Snowhill <i18n@forstwoof.ru>
|
* @author Foster Snowhill <i18n@forstwoof.ru>
|
||||||
* @author ProjectSoft <projectsoft2009@yandex.ru>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: не удалось пройти аутентификацию.';
|
$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.';
|
||||||
$PHPMAILER_LANG['buggy_php'] = 'В вашей версии PHP есть ошибка, которая может привести к повреждению сообщений. Чтобы исправить, переключитесь на отправку по SMTP, отключите опцию mail.add_x_header в ваш php.ini, переключитесь на MacOS или Linux или обновите PHP до версии 7.0.17+ или 7.1.3+.';
|
|
||||||
$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.';
|
$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.';
|
||||||
$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.';
|
$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.';
|
||||||
$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение';
|
|
||||||
$PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: ';
|
$PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: ';
|
||||||
$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: ';
|
$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: ';
|
||||||
$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: ';
|
|
||||||
$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: ';
|
$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: ';
|
||||||
$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: ';
|
$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: ';
|
||||||
$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: ';
|
$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: ';
|
||||||
$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().';
|
$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().';
|
||||||
$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: ';
|
$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один email-адрес получателя.';
|
||||||
$PHPMAILER_LANG['invalid_header'] = 'Неверное имя или значение заголовка';
|
|
||||||
$PHPMAILER_LANG['invalid_hostentry'] = 'Неверная запись хоста: ';
|
|
||||||
$PHPMAILER_LANG['invalid_host'] = 'Неверный хост: ';
|
|
||||||
$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.';
|
$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.';
|
||||||
$PHPMAILER_LANG['provide_address'] = 'Вы должны указать хотя бы один адрес электронной почты получателя.';
|
$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалась отправка таким адресатам: ';
|
||||||
$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: Ошибка следующих получателей: ';
|
$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение';
|
||||||
|
$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: ';
|
||||||
$PHPMAILER_LANG['signing'] = 'Ошибка подписи: ';
|
$PHPMAILER_LANG['signing'] = 'Ошибка подписи: ';
|
||||||
$PHPMAILER_LANG['smtp_code'] = 'Код SMTP: ';
|
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером';
|
||||||
$PHPMAILER_LANG['smtp_code_ex'] = 'Дополнительная информация SMTP: ';
|
|
||||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером.';
|
|
||||||
$PHPMAILER_LANG['smtp_detail'] = 'Детали: ';
|
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: ';
|
$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: ';
|
||||||
$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: ';
|
$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: ';
|
||||||
|
$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: ';
|
||||||
|
|
|
@ -11,28 +11,21 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$PHPMAILER_LANG['authenticate'] = 'SMTP Hatası: Oturum açılamadı.';
|
$PHPMAILER_LANG['authenticate'] = 'SMTP Hatası: Oturum açılamadı.';
|
||||||
$PHPMAILER_LANG['buggy_php'] = 'PHP sürümünüz iletilerin bozulmasına neden olabilecek bir hatadan etkileniyor. Bunu düzeltmek için, SMTP kullanarak göndermeye geçin, mail.add_x_header seçeneğini devre dışı bırakın php.ini dosyanızdaki mail.add_x_header seçeneğini devre dışı bırakın, MacOS veya Linux geçin veya PHP sürümünü 7.0.17+ veya 7.1.3+ sürümüne yükseltin,';
|
|
||||||
$PHPMAILER_LANG['connect_host'] = 'SMTP Hatası: SMTP sunucusuna bağlanılamadı.';
|
$PHPMAILER_LANG['connect_host'] = 'SMTP Hatası: SMTP sunucusuna bağlanılamadı.';
|
||||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatası: Veri kabul edilmedi.';
|
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatası: Veri kabul edilmedi.';
|
||||||
$PHPMAILER_LANG['empty_message'] = 'Mesajın içeriği boş';
|
$PHPMAILER_LANG['empty_message'] = 'Mesajın içeriği boş';
|
||||||
$PHPMAILER_LANG['encoding'] = 'Bilinmeyen karakter kodlama: ';
|
$PHPMAILER_LANG['encoding'] = 'Bilinmeyen karakter kodlama: ';
|
||||||
$PHPMAILER_LANG['execute'] = 'Çalıştırılamadı: ';
|
$PHPMAILER_LANG['execute'] = 'Çalıştırılamadı: ';
|
||||||
$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: ';
|
|
||||||
$PHPMAILER_LANG['file_access'] = 'Dosyaya erişilemedi: ';
|
$PHPMAILER_LANG['file_access'] = 'Dosyaya erişilemedi: ';
|
||||||
$PHPMAILER_LANG['file_open'] = 'Dosya Hatası: Dosya açılamadı: ';
|
$PHPMAILER_LANG['file_open'] = 'Dosya Hatası: Dosya açılamadı: ';
|
||||||
$PHPMAILER_LANG['from_failed'] = 'Belirtilen adreslere gönderme başarısız: ';
|
$PHPMAILER_LANG['from_failed'] = 'Belirtilen adreslere gönderme başarısız: ';
|
||||||
$PHPMAILER_LANG['instantiate'] = 'Örnek e-posta fonksiyonu oluşturulamadı.';
|
$PHPMAILER_LANG['instantiate'] = 'Örnek e-posta fonksiyonu oluşturulamadı.';
|
||||||
$PHPMAILER_LANG['invalid_address'] = 'Geçersiz e-posta adresi: ';
|
$PHPMAILER_LANG['invalid_address'] = 'Geçersiz e-posta adresi: ';
|
||||||
$PHPMAILER_LANG['invalid_header'] = 'Geçersiz başlık adı veya değeri: ';
|
|
||||||
$PHPMAILER_LANG['invalid_hostentry'] = 'Geçersiz ana bilgisayar girişi: ';
|
|
||||||
$PHPMAILER_LANG['invalid_host'] = 'Geçersiz ana bilgisayar: ';
|
|
||||||
$PHPMAILER_LANG['mailer_not_supported'] = ' e-posta kütüphanesi desteklenmiyor.';
|
$PHPMAILER_LANG['mailer_not_supported'] = ' e-posta kütüphanesi desteklenmiyor.';
|
||||||
$PHPMAILER_LANG['provide_address'] = 'En az bir alıcı e-posta adresi belirtmelisiniz.';
|
$PHPMAILER_LANG['provide_address'] = 'En az bir alıcı e-posta adresi belirtmelisiniz.';
|
||||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatası: Belirtilen alıcılara ulaşılamadı: ';
|
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatası: Belirtilen alıcılara ulaşılamadı: ';
|
||||||
$PHPMAILER_LANG['signing'] = 'İmzalama hatası: ';
|
$PHPMAILER_LANG['signing'] = 'İmzalama hatası: ';
|
||||||
$PHPMAILER_LANG['smtp_code'] = 'SMTP kodu: ';
|
|
||||||
$PHPMAILER_LANG['smtp_code_ex'] = 'ek SMTP bilgileri: ';
|
|
||||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() fonksiyonu başarısız.';
|
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() fonksiyonu başarısız.';
|
||||||
$PHPMAILER_LANG['smtp_detail'] = 'SMTP SMTP Detayı: ';
|
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'SMTP sunucu hatası: ';
|
$PHPMAILER_LANG['smtp_error'] = 'SMTP sunucu hatası: ';
|
||||||
$PHPMAILER_LANG['variable_set'] = 'Değişken ayarlanamadı ya da sıfırlanamadı: ';
|
$PHPMAILER_LANG['variable_set'] = 'Değişken ayarlanamadı ya da sıfırlanamadı: ';
|
||||||
|
$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: ';
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Urdu PHPMailer language file: refer to English translation for definitive list
|
|
||||||
* @package PHPMailer
|
|
||||||
* @author Saqib Ali Siddiqui <saqibsra@gmail.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
$PHPMAILER_LANG['authenticate'] = 'SMTP خرابی: تصدیق کرنے سے قاصر۔';
|
|
||||||
$PHPMAILER_LANG['connect_host'] = 'SMTP خرابی: سرور سے منسلک ہونے سے قاصر۔';
|
|
||||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP خرابی: ڈیٹا قبول نہیں کیا گیا۔';
|
|
||||||
$PHPMAILER_LANG['empty_message'] = 'پیغام کی باڈی خالی ہے۔';
|
|
||||||
$PHPMAILER_LANG['encoding'] = 'نامعلوم انکوڈنگ: ';
|
|
||||||
$PHPMAILER_LANG['execute'] = 'عمل کرنے کے قابل نہیں ';
|
|
||||||
$PHPMAILER_LANG['file_access'] = 'فائل تک رسائی سے قاصر:';
|
|
||||||
$PHPMAILER_LANG['file_open'] = 'فائل کی خرابی: فائل کو کھولنے سے قاصر:';
|
|
||||||
$PHPMAILER_LANG['from_failed'] = 'درج ذیل بھیجنے والے کا پتہ ناکام ہو گیا:';
|
|
||||||
$PHPMAILER_LANG['instantiate'] = 'میل فنکشن کی مثال بنانے سے قاصر۔';
|
|
||||||
$PHPMAILER_LANG['invalid_address'] = 'بھیجنے سے قاصر: غلط ای میل پتہ:';
|
|
||||||
$PHPMAILER_LANG['mailer_not_supported'] = ' میلر تعاون یافتہ نہیں ہے۔';
|
|
||||||
$PHPMAILER_LANG['provide_address'] = 'آپ کو کم از کم ایک منزل کا ای میل پتہ فراہم کرنا چاہیے۔';
|
|
||||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP خرابی: درج ذیل پتہ پر نہیں بھیجا جاسکا: ';
|
|
||||||
$PHPMAILER_LANG['signing'] = 'دستخط کی خرابی: ';
|
|
||||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP ملنا ناکام ہوا';
|
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'SMTP سرور کی خرابی: ';
|
|
||||||
$PHPMAILER_LANG['variable_set'] = 'متغیر سیٹ نہیں کیا جا سکا: ';
|
|
||||||
$PHPMAILER_LANG['extension_missing'] = 'ایکٹینشن موجود نہیں ہے۔ ';
|
|
||||||
$PHPMAILER_LANG['smtp_code'] = 'SMTP سرور کوڈ: ';
|
|
||||||
$PHPMAILER_LANG['smtp_code_ex'] = 'اضافی SMTP سرور کی معلومات:';
|
|
||||||
$PHPMAILER_LANG['invalid_header'] = 'غلط ہیڈر کا نام یا قدر';
|
|
|
@ -13,7 +13,7 @@
|
||||||
* @copyright 2012 - 2023 Marcus Bointon
|
* @copyright 2012 - 2023 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* @copyright 2012 - 2020 Marcus Bointon
|
* @copyright 2012 - 2020 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* @copyright 2012 - 2020 Marcus Bointon
|
* @copyright 2012 - 2020 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
@ -29,7 +29,7 @@ use League\OAuth2\Client\Token\AccessToken;
|
||||||
* OAuth - OAuth2 authentication wrapper class.
|
* OAuth - OAuth2 authentication wrapper class.
|
||||||
* Uses the oauth2-client package from the League of Extraordinary Packages.
|
* Uses the oauth2-client package from the League of Extraordinary Packages.
|
||||||
*
|
*
|
||||||
* @see https://oauth2-client.thephpleague.com
|
* @see http://oauth2-client.thephpleague.com
|
||||||
*
|
*
|
||||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* @copyright 2012 - 2020 Marcus Bointon
|
* @copyright 2012 - 2020 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* @copyright 2012 - 2020 Marcus Bointon
|
* @copyright 2012 - 2020 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
@ -152,7 +152,8 @@ class PHPMailer
|
||||||
* Only supported in simple alt or alt_inline message types
|
* Only supported in simple alt or alt_inline message types
|
||||||
* To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator.
|
* To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator.
|
||||||
*
|
*
|
||||||
* @see https://kigkonsult.se/iCalcreator/
|
* @see http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/
|
||||||
|
* @see http://kigkonsult.se/iCalcreator/
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
@ -253,7 +254,7 @@ class PHPMailer
|
||||||
* You can set your own, but it must be in the format "<id@domain>",
|
* You can set your own, but it must be in the format "<id@domain>",
|
||||||
* as defined in RFC5322 section 3.6.4 or it will be ignored.
|
* as defined in RFC5322 section 3.6.4 or it will be ignored.
|
||||||
*
|
*
|
||||||
* @see https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4
|
* @see https://tools.ietf.org/html/rfc5322#section-3.6.4
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
@ -357,7 +358,7 @@ class PHPMailer
|
||||||
public $AuthType = '';
|
public $AuthType = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP SMTPXClient command attributes
|
* SMTP SMTPXClient command attibutes
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
@ -387,7 +388,7 @@ class PHPMailer
|
||||||
* 'DELAY' will notify you if there is an unusual delay in delivery, but the actual
|
* 'DELAY' will notify you if there is an unusual delay in delivery, but the actual
|
||||||
* delivery's outcome (success or failure) is not yet decided.
|
* delivery's outcome (success or failure) is not yet decided.
|
||||||
*
|
*
|
||||||
* @see https://www.rfc-editor.org/rfc/rfc3461.html#section-4.1 for more information about NOTIFY
|
* @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY
|
||||||
*/
|
*/
|
||||||
public $dsn = '';
|
public $dsn = '';
|
||||||
|
|
||||||
|
@ -467,7 +468,7 @@ class PHPMailer
|
||||||
* Only applicable when sending via SMTP.
|
* Only applicable when sending via SMTP.
|
||||||
*
|
*
|
||||||
* @see https://en.wikipedia.org/wiki/Variable_envelope_return_path
|
* @see https://en.wikipedia.org/wiki/Variable_envelope_return_path
|
||||||
* @see https://www.postfix.org/VERP_README.html Postfix VERP info
|
* @see http://www.postfix.org/VERP_README.html Postfix VERP info
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
|
@ -550,10 +551,10 @@ class PHPMailer
|
||||||
* The function that handles the result of the send email action.
|
* The function that handles the result of the send email action.
|
||||||
* It is called out by send() for each email sent.
|
* It is called out by send() for each email sent.
|
||||||
*
|
*
|
||||||
* Value can be any php callable: https://www.php.net/is_callable
|
* Value can be any php callable: http://www.php.net/is_callable
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* bool $result result of the send action
|
* bool $result result of the send action
|
||||||
* array $to email addresses of the recipients
|
* array $to email addresses of the recipients
|
||||||
* array $cc cc email addresses
|
* array $cc cc email addresses
|
||||||
* array $bcc bcc email addresses
|
* array $bcc bcc email addresses
|
||||||
|
@ -580,10 +581,6 @@ class PHPMailer
|
||||||
* May be a callable to inject your own validator, but there are several built-in validators.
|
* May be a callable to inject your own validator, but there are several built-in validators.
|
||||||
* The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option.
|
* The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option.
|
||||||
*
|
*
|
||||||
* If CharSet is UTF8, the validator is left at the default value,
|
|
||||||
* and you send to addresses that use non-ASCII local parts, then
|
|
||||||
* PHPMailer automatically changes to the 'eai' validator.
|
|
||||||
*
|
|
||||||
* @see PHPMailer::validateAddress()
|
* @see PHPMailer::validateAddress()
|
||||||
*
|
*
|
||||||
* @var string|callable
|
* @var string|callable
|
||||||
|
@ -663,14 +660,6 @@ class PHPMailer
|
||||||
*/
|
*/
|
||||||
protected $ReplyToQueue = [];
|
protected $ReplyToQueue = [];
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether the need for SMTPUTF8 has been detected. Set by
|
|
||||||
* preSend() if necessary.
|
|
||||||
*
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
public $UseSMTPUTF8 = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The array of attachments.
|
* The array of attachments.
|
||||||
*
|
*
|
||||||
|
@ -768,7 +757,7 @@ class PHPMailer
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const VERSION = '6.10.0';
|
const VERSION = '6.9.1';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Error severity: message only, continue processing.
|
* Error severity: message only, continue processing.
|
||||||
|
@ -914,7 +903,7 @@ class PHPMailer
|
||||||
}
|
}
|
||||||
//Is this a PSR-3 logger?
|
//Is this a PSR-3 logger?
|
||||||
if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) {
|
if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) {
|
||||||
$this->Debugoutput->debug(rtrim($str, "\r\n"));
|
$this->Debugoutput->debug($str);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1083,7 +1072,7 @@ class PHPMailer
|
||||||
* be modified after calling this function), addition of such addresses is delayed until send().
|
* be modified after calling this function), addition of such addresses is delayed until send().
|
||||||
* Addresses that have been added already return false, but do not throw exceptions.
|
* Addresses that have been added already return false, but do not throw exceptions.
|
||||||
*
|
*
|
||||||
* @param string $kind One of 'to', 'cc', 'bcc', or 'Reply-To'
|
* @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo'
|
||||||
* @param string $address The email address
|
* @param string $address The email address
|
||||||
* @param string $name An optional username associated with the address
|
* @param string $name An optional username associated with the address
|
||||||
*
|
*
|
||||||
|
@ -1122,22 +1111,19 @@ class PHPMailer
|
||||||
$params = [$kind, $address, $name];
|
$params = [$kind, $address, $name];
|
||||||
//Enqueue addresses with IDN until we know the PHPMailer::$CharSet.
|
//Enqueue addresses with IDN until we know the PHPMailer::$CharSet.
|
||||||
//Domain is assumed to be whatever is after the last @ symbol in the address
|
//Domain is assumed to be whatever is after the last @ symbol in the address
|
||||||
if ($this->has8bitChars(substr($address, ++$pos))) {
|
if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) {
|
||||||
if (static::idnSupported()) {
|
if ('Reply-To' !== $kind) {
|
||||||
if ('Reply-To' !== $kind) {
|
if (!array_key_exists($address, $this->RecipientsQueue)) {
|
||||||
if (!array_key_exists($address, $this->RecipientsQueue)) {
|
$this->RecipientsQueue[$address] = $params;
|
||||||
$this->RecipientsQueue[$address] = $params;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} elseif (!array_key_exists($address, $this->ReplyToQueue)) {
|
|
||||||
$this->ReplyToQueue[$address] = $params;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
} elseif (!array_key_exists($address, $this->ReplyToQueue)) {
|
||||||
|
$this->ReplyToQueue[$address] = $params;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
//We have an 8-bit domain, but we are missing the necessary extensions to support it
|
|
||||||
//Or we are already sending to this address
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1175,15 +1161,6 @@ class PHPMailer
|
||||||
*/
|
*/
|
||||||
protected function addAnAddress($kind, $address, $name = '')
|
protected function addAnAddress($kind, $address, $name = '')
|
||||||
{
|
{
|
||||||
if (
|
|
||||||
self::$validator === 'php' &&
|
|
||||||
((bool) preg_match('/[\x80-\xFF]/', $address))
|
|
||||||
) {
|
|
||||||
//The caller has not altered the validator and is sending to an address
|
|
||||||
//with UTF-8, so assume that they want UTF-8 support instead of failing
|
|
||||||
$this->CharSet = self::CHARSET_UTF8;
|
|
||||||
self::$validator = 'eai';
|
|
||||||
}
|
|
||||||
if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) {
|
if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) {
|
||||||
$error_message = sprintf(
|
$error_message = sprintf(
|
||||||
'%s: %s',
|
'%s: %s',
|
||||||
|
@ -1235,7 +1212,7 @@ class PHPMailer
|
||||||
* Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available.
|
* Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available.
|
||||||
* Note that quotes in the name part are removed.
|
* Note that quotes in the name part are removed.
|
||||||
*
|
*
|
||||||
* @see https://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation
|
* @see http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation
|
||||||
*
|
*
|
||||||
* @param string $addrstr The address list string
|
* @param string $addrstr The address list string
|
||||||
* @param bool $useimap Whether to use the IMAP extension to parse the list
|
* @param bool $useimap Whether to use the IMAP extension to parse the list
|
||||||
|
@ -1386,7 +1363,6 @@ class PHPMailer
|
||||||
* * `pcre` Use old PCRE implementation;
|
* * `pcre` Use old PCRE implementation;
|
||||||
* * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
|
* * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
|
||||||
* * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
|
* * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
|
||||||
* * `eai` Use a pattern similar to the HTML5 spec for 'email' and to firefox, extended to support EAI (RFC6530).
|
|
||||||
* * `noregex` Don't use a regex: super fast, really dumb.
|
* * `noregex` Don't use a regex: super fast, really dumb.
|
||||||
* Alternatively you may pass in a callable to inject your own validator, for example:
|
* Alternatively you may pass in a callable to inject your own validator, for example:
|
||||||
*
|
*
|
||||||
|
@ -1431,6 +1407,7 @@ class PHPMailer
|
||||||
* * IPv6 literals: 'first.last@[IPv6:a1::]'
|
* * IPv6 literals: 'first.last@[IPv6:a1::]'
|
||||||
* Not all of these will necessarily work for sending!
|
* Not all of these will necessarily work for sending!
|
||||||
*
|
*
|
||||||
|
* @see http://squiloople.com/2009/12/20/email-address-validation/
|
||||||
* @copyright 2009-2010 Michael Rushton
|
* @copyright 2009-2010 Michael Rushton
|
||||||
* Feel free to use and redistribute this code. But please keep this copyright notice.
|
* Feel free to use and redistribute this code. But please keep this copyright notice.
|
||||||
*/
|
*/
|
||||||
|
@ -1457,24 +1434,6 @@ class PHPMailer
|
||||||
'[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD',
|
'[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD',
|
||||||
$address
|
$address
|
||||||
);
|
);
|
||||||
case 'eai':
|
|
||||||
/*
|
|
||||||
* This is the pattern used in the HTML5 spec for validation of 'email' type
|
|
||||||
* form input elements (as above), modified to accept Unicode email addresses.
|
|
||||||
* This is also more lenient than Firefox' html5 spec, in order to make the regex faster.
|
|
||||||
* 'eai' is an acronym for Email Address Internationalization.
|
|
||||||
* This validator is selected automatically if you attempt to use recipient addresses
|
|
||||||
* that contain Unicode characters in the local part.
|
|
||||||
*
|
|
||||||
* @see https://html.spec.whatwg.org/#e-mail-state-(type=email)
|
|
||||||
* @see https://en.wikipedia.org/wiki/International_email
|
|
||||||
*/
|
|
||||||
return (bool) preg_match(
|
|
||||||
'/^[-\p{L}\p{N}\p{M}.!#$%&\'*+\/=?^_`{|}~]+@[\p{L}\p{N}\p{M}](?:[\p{L}\p{N}\p{M}-]{0,61}' .
|
|
||||||
'[\p{L}\p{N}\p{M}])?(?:\.[\p{L}\p{N}\p{M}]' .
|
|
||||||
'(?:[-\p{L}\p{N}\p{M}]{0,61}[\p{L}\p{N}\p{M}])?)*$/usD',
|
|
||||||
$address
|
|
||||||
);
|
|
||||||
case 'php':
|
case 'php':
|
||||||
default:
|
default:
|
||||||
return filter_var($address, FILTER_VALIDATE_EMAIL) !== false;
|
return filter_var($address, FILTER_VALIDATE_EMAIL) !== false;
|
||||||
|
@ -1608,26 +1567,9 @@ class PHPMailer
|
||||||
$this->error_count = 0; //Reset errors
|
$this->error_count = 0; //Reset errors
|
||||||
$this->mailHeader = '';
|
$this->mailHeader = '';
|
||||||
|
|
||||||
//The code below tries to support full use of Unicode,
|
|
||||||
//while remaining compatible with legacy SMTP servers to
|
|
||||||
//the greatest degree possible: If the message uses
|
|
||||||
//Unicode in the local parts of any addresses, it is sent
|
|
||||||
//using SMTPUTF8. If not, it it sent using
|
|
||||||
//punycode-encoded domains and plain SMTP.
|
|
||||||
if (
|
|
||||||
static::CHARSET_UTF8 === strtolower($this->CharSet) &&
|
|
||||||
($this->anyAddressHasUnicodeLocalPart($this->RecipientsQueue) ||
|
|
||||||
$this->anyAddressHasUnicodeLocalPart(array_keys($this->all_recipients)) ||
|
|
||||||
$this->anyAddressHasUnicodeLocalPart($this->ReplyToQueue) ||
|
|
||||||
$this->addressHasUnicodeLocalPart($this->From))
|
|
||||||
) {
|
|
||||||
$this->UseSMTPUTF8 = true;
|
|
||||||
}
|
|
||||||
//Dequeue recipient and Reply-To addresses with IDN
|
//Dequeue recipient and Reply-To addresses with IDN
|
||||||
foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) {
|
foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) {
|
||||||
if (!$this->UseSMTPUTF8) {
|
$params[1] = $this->punyencodeAddress($params[1]);
|
||||||
$params[1] = $this->punyencodeAddress($params[1]);
|
|
||||||
}
|
|
||||||
call_user_func_array([$this, 'addAnAddress'], $params);
|
call_user_func_array([$this, 'addAnAddress'], $params);
|
||||||
}
|
}
|
||||||
if (count($this->to) + count($this->cc) + count($this->bcc) < 1) {
|
if (count($this->to) + count($this->cc) + count($this->bcc) < 1) {
|
||||||
|
@ -1792,8 +1734,9 @@ class PHPMailer
|
||||||
//This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
|
//This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
|
||||||
//A space after `-f` is optional, but there is a long history of its presence
|
//A space after `-f` is optional, but there is a long history of its presence
|
||||||
//causing problems, so we don't use one
|
//causing problems, so we don't use one
|
||||||
//Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
|
//Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
|
||||||
//Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html
|
//Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html
|
||||||
|
//Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html
|
||||||
//Example problem: https://www.drupal.org/node/1057954
|
//Example problem: https://www.drupal.org/node/1057954
|
||||||
|
|
||||||
//PHP 5.6 workaround
|
//PHP 5.6 workaround
|
||||||
|
@ -1931,7 +1874,7 @@ class PHPMailer
|
||||||
*/
|
*/
|
||||||
protected static function isPermittedPath($path)
|
protected static function isPermittedPath($path)
|
||||||
{
|
{
|
||||||
//Matches scheme definition from https://www.rfc-editor.org/rfc/rfc3986#section-3.1
|
//Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1
|
||||||
return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path);
|
return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1958,7 +1901,7 @@ class PHPMailer
|
||||||
/**
|
/**
|
||||||
* Send mail using the PHP mail() function.
|
* Send mail using the PHP mail() function.
|
||||||
*
|
*
|
||||||
* @see https://www.php.net/manual/en/book.mail.php
|
* @see http://www.php.net/manual/en/book.mail.php
|
||||||
*
|
*
|
||||||
* @param string $header The message headers
|
* @param string $header The message headers
|
||||||
* @param string $body The message body
|
* @param string $body The message body
|
||||||
|
@ -1988,8 +1931,9 @@ class PHPMailer
|
||||||
//This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
|
//This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
|
||||||
//A space after `-f` is optional, but there is a long history of its presence
|
//A space after `-f` is optional, but there is a long history of its presence
|
||||||
//causing problems, so we don't use one
|
//causing problems, so we don't use one
|
||||||
//Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
|
//Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
|
||||||
//Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html
|
//Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html
|
||||||
|
//Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html
|
||||||
//Example problem: https://www.drupal.org/node/1057954
|
//Example problem: https://www.drupal.org/node/1057954
|
||||||
//CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
|
//CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
|
||||||
|
|
||||||
|
@ -2118,11 +2062,6 @@ class PHPMailer
|
||||||
if (!$this->smtpConnect($this->SMTPOptions)) {
|
if (!$this->smtpConnect($this->SMTPOptions)) {
|
||||||
throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
|
throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
|
||||||
}
|
}
|
||||||
//If we have recipient addresses that need Unicode support,
|
|
||||||
//but the server doesn't support it, stop here
|
|
||||||
if ($this->UseSMTPUTF8 && !$this->smtp->getServerExt('SMTPUTF8')) {
|
|
||||||
throw new Exception($this->lang('no_smtputf8'), self::STOP_CRITICAL);
|
|
||||||
}
|
|
||||||
//Sender already validated in preSend()
|
//Sender already validated in preSend()
|
||||||
if ('' === $this->Sender) {
|
if ('' === $this->Sender) {
|
||||||
$smtp_from = $this->From;
|
$smtp_from = $this->From;
|
||||||
|
@ -2224,7 +2163,6 @@ class PHPMailer
|
||||||
$this->smtp->setDebugLevel($this->SMTPDebug);
|
$this->smtp->setDebugLevel($this->SMTPDebug);
|
||||||
$this->smtp->setDebugOutput($this->Debugoutput);
|
$this->smtp->setDebugOutput($this->Debugoutput);
|
||||||
$this->smtp->setVerp($this->do_verp);
|
$this->smtp->setVerp($this->do_verp);
|
||||||
$this->smtp->setSMTPUTF8($this->UseSMTPUTF8);
|
|
||||||
if ($this->Host === null) {
|
if ($this->Host === null) {
|
||||||
$this->Host = 'localhost';
|
$this->Host = 'localhost';
|
||||||
}
|
}
|
||||||
|
@ -2422,7 +2360,6 @@ class PHPMailer
|
||||||
'smtp_detail' => 'Detail: ',
|
'smtp_detail' => 'Detail: ',
|
||||||
'smtp_error' => 'SMTP server error: ',
|
'smtp_error' => 'SMTP server error: ',
|
||||||
'variable_set' => 'Cannot set or reset variable: ',
|
'variable_set' => 'Cannot set or reset variable: ',
|
||||||
'no_smtputf8' => 'Server does not support SMTPUTF8 needed to send to Unicode addresses',
|
|
||||||
];
|
];
|
||||||
if (empty($lang_path)) {
|
if (empty($lang_path)) {
|
||||||
//Calculate an absolute path so it can work if CWD is not here
|
//Calculate an absolute path so it can work if CWD is not here
|
||||||
|
@ -2772,7 +2709,7 @@ class PHPMailer
|
||||||
}
|
}
|
||||||
|
|
||||||
//Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4
|
//Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4
|
||||||
//https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4
|
//https://tools.ietf.org/html/rfc5322#section-3.6.4
|
||||||
if (
|
if (
|
||||||
'' !== $this->MessageID &&
|
'' !== $this->MessageID &&
|
||||||
preg_match(
|
preg_match(
|
||||||
|
@ -2937,9 +2874,7 @@ class PHPMailer
|
||||||
$bodyEncoding = $this->Encoding;
|
$bodyEncoding = $this->Encoding;
|
||||||
$bodyCharSet = $this->CharSet;
|
$bodyCharSet = $this->CharSet;
|
||||||
//Can we do a 7-bit downgrade?
|
//Can we do a 7-bit downgrade?
|
||||||
if ($this->UseSMTPUTF8) {
|
if (static::ENCODING_8BIT === $bodyEncoding && !$this->has8bitChars($this->Body)) {
|
||||||
$bodyEncoding = static::ENCODING_8BIT;
|
|
||||||
} elseif (static::ENCODING_8BIT === $bodyEncoding && !$this->has8bitChars($this->Body)) {
|
|
||||||
$bodyEncoding = static::ENCODING_7BIT;
|
$bodyEncoding = static::ENCODING_7BIT;
|
||||||
//All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
|
//All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
|
||||||
$bodyCharSet = static::CHARSET_ASCII;
|
$bodyCharSet = static::CHARSET_ASCII;
|
||||||
|
@ -3576,8 +3511,7 @@ class PHPMailer
|
||||||
/**
|
/**
|
||||||
* Encode a header value (not including its label) optimally.
|
* Encode a header value (not including its label) optimally.
|
||||||
* Picks shortest of Q, B, or none. Result includes folding if needed.
|
* Picks shortest of Q, B, or none. Result includes folding if needed.
|
||||||
* See RFC822 definitions for phrase, comment and text positions,
|
* See RFC822 definitions for phrase, comment and text positions.
|
||||||
* and RFC2047 for inline encodings.
|
|
||||||
*
|
*
|
||||||
* @param string $str The header value to encode
|
* @param string $str The header value to encode
|
||||||
* @param string $position What context the string will be used in
|
* @param string $position What context the string will be used in
|
||||||
|
@ -3586,11 +3520,6 @@ class PHPMailer
|
||||||
*/
|
*/
|
||||||
public function encodeHeader($str, $position = 'text')
|
public function encodeHeader($str, $position = 'text')
|
||||||
{
|
{
|
||||||
$position = strtolower($position);
|
|
||||||
if ($this->UseSMTPUTF8 && !("comment" === $position)) {
|
|
||||||
return trim(static::normalizeBreaks($str));
|
|
||||||
}
|
|
||||||
|
|
||||||
$matchcount = 0;
|
$matchcount = 0;
|
||||||
switch (strtolower($position)) {
|
switch (strtolower($position)) {
|
||||||
case 'phrase':
|
case 'phrase':
|
||||||
|
@ -3705,7 +3634,7 @@ class PHPMailer
|
||||||
* without breaking lines within a character.
|
* without breaking lines within a character.
|
||||||
* Adapted from a function by paravoid.
|
* Adapted from a function by paravoid.
|
||||||
*
|
*
|
||||||
* @see https://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283
|
* @see http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283
|
||||||
*
|
*
|
||||||
* @param string $str multi-byte text to wrap encode
|
* @param string $str multi-byte text to wrap encode
|
||||||
* @param string $linebreak string to use as linefeed/end-of-line
|
* @param string $linebreak string to use as linefeed/end-of-line
|
||||||
|
@ -3761,7 +3690,7 @@ class PHPMailer
|
||||||
/**
|
/**
|
||||||
* Encode a string using Q encoding.
|
* Encode a string using Q encoding.
|
||||||
*
|
*
|
||||||
* @see https://www.rfc-editor.org/rfc/rfc2047#section-4.2
|
* @see http://tools.ietf.org/html/rfc2047#section-4.2
|
||||||
*
|
*
|
||||||
* @param string $str the text to encode
|
* @param string $str the text to encode
|
||||||
* @param string $position Where the text is going to be used, see the RFC for what that means
|
* @param string $position Where the text is going to be used, see the RFC for what that means
|
||||||
|
@ -4255,7 +4184,7 @@ class PHPMailer
|
||||||
if ('smtp' === $this->Mailer && null !== $this->smtp) {
|
if ('smtp' === $this->Mailer && null !== $this->smtp) {
|
||||||
$lasterror = $this->smtp->getError();
|
$lasterror = $this->smtp->getError();
|
||||||
if (!empty($lasterror['error'])) {
|
if (!empty($lasterror['error'])) {
|
||||||
$msg .= ' ' . $this->lang('smtp_error') . $lasterror['error'];
|
$msg .= $this->lang('smtp_error') . $lasterror['error'];
|
||||||
if (!empty($lasterror['detail'])) {
|
if (!empty($lasterror['detail'])) {
|
||||||
$msg .= ' ' . $this->lang('smtp_detail') . $lasterror['detail'];
|
$msg .= ' ' . $this->lang('smtp_detail') . $lasterror['detail'];
|
||||||
}
|
}
|
||||||
|
@ -4299,7 +4228,7 @@ class PHPMailer
|
||||||
$result = $_SERVER['SERVER_NAME'];
|
$result = $_SERVER['SERVER_NAME'];
|
||||||
} elseif (function_exists('gethostname') && gethostname() !== false) {
|
} elseif (function_exists('gethostname') && gethostname() !== false) {
|
||||||
$result = gethostname();
|
$result = gethostname();
|
||||||
} elseif (php_uname('n') !== '') {
|
} elseif (php_uname('n') !== false) {
|
||||||
$result = php_uname('n');
|
$result = php_uname('n');
|
||||||
}
|
}
|
||||||
if (!static::isValidHost($result)) {
|
if (!static::isValidHost($result)) {
|
||||||
|
@ -4324,7 +4253,7 @@ class PHPMailer
|
||||||
empty($host)
|
empty($host)
|
||||||
|| !is_string($host)
|
|| !is_string($host)
|
||||||
|| strlen($host) > 256
|
|| strlen($host) > 256
|
||||||
|| !preg_match('/^([a-z\d.-]*|\[[a-f\d:]+\])$/i', $host)
|
|| !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+\])$/', $host)
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -4338,49 +4267,10 @@ class PHPMailer
|
||||||
//Is it a valid IPv4 address?
|
//Is it a valid IPv4 address?
|
||||||
return filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;
|
return filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;
|
||||||
}
|
}
|
||||||
//Is it a syntactically valid hostname (when embedded in a URL)?
|
//Is it a syntactically valid hostname (when embeded in a URL)?
|
||||||
return filter_var('https://' . $host, FILTER_VALIDATE_URL) !== false;
|
return filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether the supplied address uses Unicode in the local part.
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
protected function addressHasUnicodeLocalPart($address)
|
|
||||||
{
|
|
||||||
return (bool) preg_match('/[\x80-\xFF].*@/', $address);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether any of the supplied addresses use Unicode in the local part.
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
protected function anyAddressHasUnicodeLocalPart($addresses)
|
|
||||||
{
|
|
||||||
foreach ($addresses as $address) {
|
|
||||||
if (is_array($address)) {
|
|
||||||
$address = $address[0];
|
|
||||||
}
|
|
||||||
if ($this->addressHasUnicodeLocalPart($address)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether the message requires SMTPUTF8 based on what's known so far.
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function needsSMTPUTF8()
|
|
||||||
{
|
|
||||||
return $this->UseSMTPUTF8;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an error message in the current language.
|
* Get an error message in the current language.
|
||||||
*
|
*
|
||||||
|
@ -4789,7 +4679,7 @@ class PHPMailer
|
||||||
* Multi-byte-safe pathinfo replacement.
|
* Multi-byte-safe pathinfo replacement.
|
||||||
* Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe.
|
* Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe.
|
||||||
*
|
*
|
||||||
* @see https://www.php.net/manual/en/function.pathinfo.php#107461
|
* @see http://www.php.net/manual/en/function.pathinfo.php#107461
|
||||||
*
|
*
|
||||||
* @param string $path A filename or path, does not need to exist as a file
|
* @param string $path A filename or path, does not need to exist as a file
|
||||||
* @param int|string $options Either a PATHINFO_* constant,
|
* @param int|string $options Either a PATHINFO_* constant,
|
||||||
|
@ -5024,7 +4914,7 @@ class PHPMailer
|
||||||
* Uses the 'relaxed' algorithm from RFC6376 section 3.4.2.
|
* Uses the 'relaxed' algorithm from RFC6376 section 3.4.2.
|
||||||
* Canonicalized headers should *always* use CRLF, regardless of mailer setting.
|
* Canonicalized headers should *always* use CRLF, regardless of mailer setting.
|
||||||
*
|
*
|
||||||
* @see https://www.rfc-editor.org/rfc/rfc6376#section-3.4.2
|
* @see https://tools.ietf.org/html/rfc6376#section-3.4.2
|
||||||
*
|
*
|
||||||
* @param string $signHeader Header
|
* @param string $signHeader Header
|
||||||
*
|
*
|
||||||
|
@ -5036,7 +4926,7 @@ class PHPMailer
|
||||||
$signHeader = static::normalizeBreaks($signHeader, self::CRLF);
|
$signHeader = static::normalizeBreaks($signHeader, self::CRLF);
|
||||||
//Unfold header lines
|
//Unfold header lines
|
||||||
//Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]`
|
//Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]`
|
||||||
//@see https://www.rfc-editor.org/rfc/rfc5322#section-2.2
|
//@see https://tools.ietf.org/html/rfc5322#section-2.2
|
||||||
//That means this may break if you do something daft like put vertical tabs in your headers.
|
//That means this may break if you do something daft like put vertical tabs in your headers.
|
||||||
$signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader);
|
$signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader);
|
||||||
//Break headers out into an array
|
//Break headers out into an array
|
||||||
|
@ -5068,7 +4958,7 @@ class PHPMailer
|
||||||
* Uses the 'simple' algorithm from RFC6376 section 3.4.3.
|
* Uses the 'simple' algorithm from RFC6376 section 3.4.3.
|
||||||
* Canonicalized bodies should *always* use CRLF, regardless of mailer setting.
|
* Canonicalized bodies should *always* use CRLF, regardless of mailer setting.
|
||||||
*
|
*
|
||||||
* @see https://www.rfc-editor.org/rfc/rfc6376#section-3.4.3
|
* @see https://tools.ietf.org/html/rfc6376#section-3.4.3
|
||||||
*
|
*
|
||||||
* @param string $body Message Body
|
* @param string $body Message Body
|
||||||
*
|
*
|
||||||
|
@ -5104,7 +4994,7 @@ class PHPMailer
|
||||||
$DKIMquery = 'dns/txt'; //Query method
|
$DKIMquery = 'dns/txt'; //Query method
|
||||||
$DKIMtime = time();
|
$DKIMtime = time();
|
||||||
//Always sign these headers without being asked
|
//Always sign these headers without being asked
|
||||||
//Recommended list from https://www.rfc-editor.org/rfc/rfc6376#section-5.4.1
|
//Recommended list from https://tools.ietf.org/html/rfc6376#section-5.4.1
|
||||||
$autoSignHeaders = [
|
$autoSignHeaders = [
|
||||||
'from',
|
'from',
|
||||||
'to',
|
'to',
|
||||||
|
@ -5210,7 +5100,7 @@ class PHPMailer
|
||||||
}
|
}
|
||||||
//The DKIM-Signature header is included in the signature *except for* the value of the `b` tag
|
//The DKIM-Signature header is included in the signature *except for* the value of the `b` tag
|
||||||
//which is appended after calculating the signature
|
//which is appended after calculating the signature
|
||||||
//https://www.rfc-editor.org/rfc/rfc6376#section-3.5
|
//https://tools.ietf.org/html/rfc6376#section-3.5
|
||||||
$dkimSignatureHeader = 'DKIM-Signature: v=1;' .
|
$dkimSignatureHeader = 'DKIM-Signature: v=1;' .
|
||||||
' d=' . $this->DKIM_domain . ';' .
|
' d=' . $this->DKIM_domain . ';' .
|
||||||
' s=' . $this->DKIM_selector . ';' . static::$LE .
|
' s=' . $this->DKIM_selector . ';' . static::$LE .
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue