Skip to content

Commit a5964d0

Browse files
author
Leonid Vakulenko
committed
Webasyst Framework v.3.8.3
1 parent e530775 commit a5964d0

File tree

14 files changed

+79
-42
lines changed

14 files changed

+79
-42
lines changed

wa-apps/installer/lib/classes/installerServicesApi.class.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public function serviceCall(
106106
if (empty($token)) {
107107
throw new waException('Unable to get access token for Webasyst service API');
108108
}
109+
$net_options += $this->getDefaultNetOptionsByService($service);
109110
$resp = $this->requestApiUrl($url, $token, $params, $http_method, $net_options);
110111
if ($resp['status'] == 401) {
111112
$token = $this->getToken($use_system_token, true);
@@ -378,4 +379,13 @@ protected function refreshApiUrlConfig()
378379
'config' => $config
379380
]);
380381
}
382+
383+
protected function getDefaultNetOptionsByService($service): array
384+
{
385+
switch ($service) {
386+
case 'AI':
387+
return ['timeout' => 30];
388+
}
389+
return [];
390+
}
381391
}

wa-apps/installer/lib/config/app.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
'description' => 'Install new apps from the Webasyst Store',
55
'icon' => 'img/installer.svg',
66
'mobile' => false,
7-
'version' => '3.8.2', // developer preview
8-
'critical' => '3.8.2',
7+
'version' => '3.8.3',
8+
'critical' => '3.8.3',
99
'system' => true,
1010
'vendor' => 'webasyst',
1111
'csrf' => true,

wa-content/css/wa/wa-2.0.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ input.state-caution, textarea.state-caution, select.state-caution, .wa-select.st
10411041
@media screen and (min-width: 761px) { /* non-mobile */
10421042

10431043
#wa-app.with-bottombar .sidebar:not(.scrolls-with-content) { height: calc(100vh - 8rem); }
1044-
#wa-app.with-bottombar .content { padding-bottom: 4rem; }
1044+
#wa-app.with-bottombar .content { padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); }
10451045

10461046
}
10471047

@@ -1053,7 +1053,7 @@ input.state-caution, textarea.state-caution, select.state-caution, .wa-select.st
10531053
.sidebar.mobile-friendly > .sidebar-body,
10541054
.sidebar.mobile-friendly > .sidebar-footer { display: none; flex: unset; }
10551055
.sidebar.mobile-friendly > .sidebar-mobile-toggle { display: block; }
1056-
#wa-app.with-bottombar .content { min-height: calc(100vh - 8rem); padding-bottom: 4rem; }
1056+
#wa-app.with-bottombar .content { min-height: calc(100vh - 8rem); padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); }
10571057
.sidebar ~ .content { min-height: calc(100vh - 7rem); }
10581058

10591059
}
@@ -1138,7 +1138,7 @@ ul.inlinebox > * { padding: 0; margin: 0; }
11381138
/* Bottom Bar
11391139
------------- */
11401140

1141-
.bottombar { position: fixed; bottom: 0; left: 0; right: 0; height: 4rem; background: var(--background-color-wa-header); box-shadow: 0 -10px 10px -10px rgba(0, 0, 0, 0.1); transition: 0.13s; z-index: 1000; box-sizing: border-box; }
1141+
.bottombar { position: fixed; bottom: 0; left: 0; right: 0; height: calc(4rem + env(safe-area-inset-bottom, 0px)); background: var(--background-color-wa-header); box-shadow: 0 -10px 10px -10px rgba(0, 0, 0, 0.1); transition: 0.13s; z-index: 1000; box-sizing: border-box; }
11421142
.bottombar.sticky { position: sticky; top: calc(100% - 4rem); }
11431143
.bottombar:hover { box-shadow: 0 -6px 12px -7px rgba(0, 0, 0, 0.2); }
11441144
.bottombar ul { height: 4rem; list-style-type: none; display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; padding: 0; }

wa-system/api/waAPIException.class.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,22 @@ public function __construct($error, $error_description = null, $status_code = nu
2222
$this->response['error_description'] = $this->error_description;
2323
}
2424
if (defined('WA_API_EXCEPTION_STACK_TRACE') && WA_API_EXCEPTION_STACK_TRACE) {
25-
$this->response['trace'] = $this->getTraceAsString();
25+
$this->response['trace'] = $this->getFullTraceAsString();
2626
}
2727
}
2828

29+
public function getFullTraceAsString()
30+
{
31+
$result = '## '.$this->getFile().'('.$this->getLine().")\n";
32+
$result .= $this->getTraceAsString();
33+
34+
$root_path = realpath(dirname(__FILE__).'/../..');
35+
$root_path = str_replace('\\', '/', $root_path);
36+
$root_path = preg_quote($root_path, '~');
37+
$result = str_replace('\\', '/', $result);
38+
return preg_replace("~(^|\s|'|\"){$root_path}/?~", '$1', $result);
39+
}
40+
2941
public function __toString()
3042
{
3143
if ($this->status_code) {

wa-system/auth/adapters/yandexAuth.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public function getRedirectUri()
2020
public function getControls()
2121
{
2222
return array(
23-
'app_id' => _ws('Client ID'),
24-
'app_secret' => _ws('Client secret'),
23+
'app_id' => 'ClientID',
24+
'app_secret' => 'Client secret',
2525
);
2626
}
2727

wa-system/contact/data/fields.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
'qq' => 'QQ',
8282
'line' => 'Line',
8383
'signal' => 'Signal',
84-
'skype' => 'Skype',
8584
'discord' => 'Discord',
8685
'slack' => 'Slack',
8786
'imessage' => 'iMessage',

wa-system/push/adapters/firebase/firebasePush.class.php

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ class firebasePush extends waPushAdapter
2323
public function __construct($options = [])
2424
{
2525
$vendor_dir = dirname(__FILE__).'/vendor/';
26+
27+
require_once($vendor_dir.'autoload.php');
28+
return;
29+
30+
if (!interface_exists('\Psr\Http\Message\UriInterface')) {
31+
require_once($vendor_dir.'psr/http-message/src/UriInterface.php');
32+
require_once($vendor_dir.'psr/http-message/src/StreamInterface.php');
33+
require_once($vendor_dir.'psr/http-message/src/MessageInterface.php');
34+
require_once($vendor_dir.'psr/http-message/src/ResponseInterface.php');
35+
require_once($vendor_dir.'psr/http-client/src/ClientExceptionInterface.php');
36+
require_once($vendor_dir.'psr/http-client/src/RequestExceptionInterface.php');
37+
require_once($vendor_dir.'psr/http-client/src/ClientInterface.php');
38+
require_once($vendor_dir.'psr/http-message/src/MessageInterface.php');
39+
require_once($vendor_dir.'psr/http-message/src/RequestInterface.php');
40+
}
41+
2642
require_once($vendor_dir.'google/auth/src/UpdateMetadataInterface.php');
2743
require_once($vendor_dir.'google/auth/src/FetchAuthTokenInterface.php');
2844
require_once($vendor_dir.'google/auth/src/GetUniverseDomainInterface.php');
@@ -32,9 +48,7 @@ public function __construct($options = [])
3248
require_once($vendor_dir.'google/auth/src/GetQuotaProjectInterface.php');
3349
require_once($vendor_dir.'google/auth/src/SignBlobInterface.php');
3450
require_once($vendor_dir.'google/auth/src/ProjectIdProviderInterface.php');
35-
require_once($vendor_dir.'psr/http-message/src/UriInterface.php');
3651
require_once($vendor_dir.'guzzlehttp/psr7/src/Uri.php');
37-
require_once($vendor_dir.'psr/http-message/src/StreamInterface.php');
3852
require_once($vendor_dir.'guzzlehttp/psr7/src/Stream.php');
3953
require_once($vendor_dir.'guzzlehttp/psr7/src/Utils.php');
4054
require_once($vendor_dir.'google/auth/src/HttpHandler/Guzzle6HttpHandler.php');
@@ -53,8 +67,6 @@ public function __construct($options = [])
5367
require_once($vendor_dir.'guzzlehttp/guzzle/src/Handler/HeaderProcessor.php');
5468
require_once($vendor_dir.'guzzlehttp/psr7/src/MessageTrait.php');
5569
require_once($vendor_dir.'guzzlehttp/psr7/src/Message.php');
56-
require_once($vendor_dir.'psr/http-message/src/MessageInterface.php');
57-
require_once($vendor_dir.'psr/http-message/src/ResponseInterface.php');
5870
require_once($vendor_dir.'guzzlehttp/psr7/src/Response.php');
5971
require_once($vendor_dir.'guzzlehttp/guzzle/src/Handler/EasyHandle.php');
6072
require_once($vendor_dir.'guzzlehttp/promises/src/TaskQueueInterface.php');
@@ -70,8 +82,6 @@ public function __construct($options = [])
7082
require_once($vendor_dir.'guzzlehttp/guzzle/src/Utils.php');
7183
require_once($vendor_dir.'guzzlehttp/psr7/src/MimeType.php');
7284
require_once($vendor_dir.'guzzlehttp/guzzle/src/PrepareBodyMiddleware.php');
73-
require_once($vendor_dir.'psr/http-client/src/ClientExceptionInterface.php');
74-
require_once($vendor_dir.'psr/http-client/src/RequestExceptionInterface.php');
7585
require_once($vendor_dir.'guzzlehttp/guzzle/src/BodySummarizerInterface.php');
7686
require_once($vendor_dir.'guzzlehttp/guzzle/src/BodySummarizer.php');
7787
require_once($vendor_dir.'guzzlehttp/guzzle/src/Exception/GuzzleException.php');
@@ -84,23 +94,12 @@ public function __construct($options = [])
8494
require_once($vendor_dir.'guzzlehttp/guzzle/src/HandlerStack.php');
8595
require_once($vendor_dir.'guzzlehttp/guzzle/src/ClientTrait.php');
8696
require_once($vendor_dir.'guzzlehttp/guzzle/src/ClientInterface.php');
87-
require_once($vendor_dir.'psr/http-client/src/ClientInterface.php');
8897
require_once($vendor_dir.'guzzlehttp/guzzle/src/RedirectMiddleware.php');
8998
require_once($vendor_dir.'guzzlehttp/guzzle/src/RequestOptions.php');
9099
require_once($vendor_dir.'guzzlehttp/psr7/src/UriResolver.php');
91-
require_once($vendor_dir.'psr/http-message/src/MessageInterface.php');
92-
require_once($vendor_dir.'psr/http-message/src/RequestInterface.php');
93100
require_once($vendor_dir.'guzzlehttp/psr7/src/Request.php');
94101
require_once($vendor_dir.'guzzlehttp/promises/src/Create.php');
95102
require_once($vendor_dir.'guzzlehttp/guzzle/src/Client.php');
96-
/*
97-
$this->request([ 'message' => [
98-
'notification' => [
99-
'title' => 'Test from DEV',
100-
'body' => 'Notification from DEV',
101-
],
102-
'token' => 'cYGZAXowkY8:APA91bFN6vd_RQKWZeq-m2SntQzUV6LRz901V38WXhlWaeAvFmjriX3UllLPAkFgN4dNj5-LoK55DrxjF9rMnTiWUv65lVLfn9Z94-yh3_7yb0knUK70HvcukQ3hlG6oDHbJfOn2-A3h',
103-
]]); */
104103
}
105104

106105
//

wa-system/sms/waSMS.class.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ public static function adapterExists($from = null, $do_filter_not_installed = fa
5252
}
5353
}
5454

55+
/** @since 3.8.2 */
56+
public static function isConfigured()
57+
{
58+
if (self::$config) {
59+
return true;
60+
}
61+
return !!self::getNoSettingsAdapter();
62+
}
63+
5564
/**
5665
* @param string $from
5766
* @throws waException

wa-system/view/waViewHelper.class.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,14 @@ private function getFavicons($domain_config)
393393
$links = '';
394394
$domain_favicons = ifset($domain_config['favicons']);
395395
if (!is_array($domain_favicons) && wa()->appExists('site')) {
396-
wa('site');
397-
siteHelper::updateFaviconsConfig($domain_config);
398-
$domain_favicons = $domain_config['favicons'];
396+
try {
397+
wa('site');
398+
if (method_exists('siteHelper','updateFaviconsConfig')) {
399+
siteHelper::updateFaviconsConfig($domain_config);
400+
$domain_favicons = $domain_config['favicons'];
401+
}
402+
} catch (Throwable $e) {
403+
}
399404
}
400405

401406
$wa_url = wa_url();
@@ -1660,7 +1665,7 @@ public function getContactTabs($id)
16601665
foreach ($one_or_more_links as $link) {
16611666
while (empty($link['id']) || isset($links[$link['id']])) {
16621667
$link['id'] = $plugin_app_id.$i;
1663-
$i++;
1668+
$i = ifempty($i, 0) + 1;
16641669
}
16651670

16661671
// Do not show tabs user has no access to and would not be able to load

wa-system/waid/services/waServicesSearch.class.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public function getAiResponse(?string $query=null, ?array $documents=null): stri
6767
'facility' => 'documents_question',
6868
'objective' => $this->query,
6969
'documents' => array_column($this->documents, 'text'),
70+
'text_format' => ifset($this->options, 'text_format', 'markdown'),
7071
], 'POST', [
7172
'timeout' => 30,
7273
]);

0 commit comments

Comments
 (0)