Skip to content

Commit

Permalink
Webasyst Framework v.2.9.6
Browse files Browse the repository at this point in the history
  * Improved support for the latest PHP versions.
  * Improved Webasyst 2 user interface.
  • Loading branch information
Leonix committed Nov 13, 2023
1 parent dc497e3 commit 0360582
Show file tree
Hide file tree
Showing 18 changed files with 69 additions and 46 deletions.
2 changes: 1 addition & 1 deletion wa-apps/installer/css/app.installer.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wa-apps/installer/js/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ String.prototype.translate = function () {
$itemClone.find('img').removeClass('userpic userpic-48 custom-mr-8');
$itemClone.addClass('-added');

const targetPosition = $itemClone.offset();
const targetPosition = $app_menu.find('li:first').offset();
const startPosition = $this.offset();

const target_params = {
Expand Down
4 changes: 2 additions & 2 deletions wa-apps/installer/lib/classes/installerItemsAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function execute()
$tag = $this->getFilters('tag');

// System plugins
if (preg_match('~^wa-plugins/~', $slug)) {
if (preg_match('~^wa-plugins/~', (string) $slug)) {
$filters['type'] = 'plugin';
$filters['category'] = 'plugins:' . preg_replace('~^wa-plugins/~', '', $slug);
} else {
Expand All @@ -42,7 +42,7 @@ public function execute()

// Set ui version from current app
// For system plugins get UI from request param with 1.3 as default
$ui = (strpos($slug, 'wa-plugins/') === 0) ? waRequest::get('ui', '1.3', waRequest::TYPE_STRING_TRIM) : wa()->whichUI($slug);
$ui = (strpos((string) $slug, 'wa-plugins/') === 0) ? waRequest::get('ui', '1.3', waRequest::TYPE_STRING_TRIM) : wa()->whichUI($slug);
waRequest::setParam('force_ui_version', $ui);
}

Expand Down
4 changes: 2 additions & 2 deletions wa-apps/installer/lib/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
'description' => 'Install new apps from the Webasyst Store',
'icon' => 'img/installer.svg',
'mobile' => false,
'version' => '2.9.5',
'critical' => '2.9.5',
'version' => '2.9.6',
'critical' => '2.9.6',
'system' => true,
'vendor' => 'webasyst',
'csrf' => true,
Expand Down
6 changes: 3 additions & 3 deletions wa-content/css/wa/wa-2.0.css
Original file line number Diff line number Diff line change
Expand Up @@ -1322,8 +1322,8 @@ button.webasyst-magic-wand:hover,
button.webasyst-magic-wand .icon,
.button.webasyst-magic-wand .icon { width: 1.25em; height: 1.25em; background-image: url('../../img/webasyst-wand-bold.svg'); background-size: 100%; vertical-align: -0.25em; margin-right: 0.25em; }

input[type="button"] { background-color: var(--background-color-btn-light-gray); color: var(--text-color-input); box-shadow: none; border-radius: 1.5em; } /* fallback for unstyled old-fashioned <input type="button"> */
input[type="button"]:hover { box-shadow: none; background-color: var(--background-color-btn-light-gray-hover); }
input[type="button"]:not(.blue, .green, .yellow, .orange, .red, .purple, .pink, .brown, .gray, .dark-gray, .black, .white) { background-color: var(--background-color-btn-light-gray); color: var(--text-color-input); box-shadow: none; } /* fallback for unstyled old-fashioned <input type="button"> */
input[type="button"]:not(.blue, .green, .yellow, .orange, .red, .purple, .pink, .brown, .gray, .dark-gray, .black, .white):hover { box-shadow: none; background-color: var(--background-color-btn-light-gray-hover); }

/* Userpic
---------- */
Expand Down Expand Up @@ -1914,7 +1914,7 @@ ul.breadcrumbs > li * > a { color: inherit; }

.fields .field:not(:first-child) { margin-top: 1rem; }
.fields .field > .name { line-height: 1.25rem; font-size: 0.875em; color: var(--text-color-hint-strong); }
.fields:not(.vertical) .field > .name { width: 9rem; padding-right: 1rem; padding-top: 0.1875rem; }
.fields:not(.vertical) .field > .name { width: 9rem; padding-right: 1rem; padding-top: 0.1875rem; word-break: break-word; }
.fields .field > .name.for-input { padding-top: 0.5625em; }
.fields .field > .name.for-button { padding-top: 0.5em; }
.fields .field > .name.for-switch { padding-top: 0.05em; }
Expand Down
12 changes: 4 additions & 8 deletions wa-content/js/jquery-wa/dashboard-mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,13 +618,9 @@ const Page = ( function($, backend_url) {
$deferred.done( function(response) {
if ( $.trim(response).length && !response.includes('activity-empty-today')) {
// Render
$wrapper.find(".empty-activity-text").remove();
let $today = $wrapper.find(".today");
if($today.length) {
$today.after(response).remove();
}else{
$wrapper.prepend(response);
}
$widgetActivity.find(".empty-activity-text").remove();
$widgetActivity.find(".activity-item.activity-empty-today").remove();
$wrapper.prepend(response);
}

that.storage.isTopLazyLoadLocked = false;
Expand Down Expand Up @@ -652,4 +648,4 @@ const Page = ( function($, backend_url) {


}
})(jQuery, backend_url);
})(jQuery, backend_url);
11 changes: 3 additions & 8 deletions wa-content/js/jquery-wa/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -1635,14 +1635,9 @@ const Page = ( function($, backend_url) {
$deferred.done( function(response) {
if ( $.trim(response).length && !response.includes('activity-empty-today')) {
// Render
$wrapper.find(".empty-activity-text").remove();
$wrapper.find(".activity-empty-today").remove();
let $today = $wrapper.find(".today");
if($today.length) {
$today.after(response).remove();
}else{
$wrapper.prepend(response);
}
$widgetActivity.find(".empty-activity-text").remove();
$widgetActivity.find(".activity-item.activity-empty-today").remove();
$wrapper.prepend(response);
}

that.storage.isTopLazyLoadLocked = false;
Expand Down
30 changes: 18 additions & 12 deletions wa-content/js/qrcode/LICENSE
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
The MIT License (MIT)
---------------------
Copyright (c) 2012 davidshimjs
https://github.com/davidshimjs/qrcodejs
MIT License

Permission is hereby granted, free of charge,
to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
Copyright (c) 2017 Ray

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 21 additions & 1 deletion wa-content/js/qrcode/qrcode.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions wa-system/api/waAPIException.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public function __construct($error, $error_description = null, $status_code = nu
if ($this->error_description) {
$this->response['error_description'] = $this->error_description;
}
if (defined('WA_API_EXCEPTION_STACK_TRACE') && WA_API_EXCEPTION_STACK_TRACE) {
$this->response['trace'] = $this->getTraceAsString();
}
}

public function __toString()
Expand Down
2 changes: 1 addition & 1 deletion wa-system/captcha/phpcaptcha/waPHPCaptcha.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function isValid($code = null, &$error = '')
$code = wa()->getRequest()->post('captcha');
}
}
$code = strtolower(trim($code));
$code = strtolower(trim((string) $code));
$captcha = wa()->getStorage()->get('captcha');
$app_id = $this->getAppId();
if (isset($captcha[$app_id]) && $captcha[$app_id] === $code) {
Expand Down
2 changes: 1 addition & 1 deletion wa-system/contact/waContactCompositeField.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public function getFields($subfield_name = null)
{
$fields = array();
foreach($this->options['fields'] as $f) {
if ($f->getId() === $subfield_name) {
if ($f->getId() === (string) $subfield_name) {
return $f;
}
$fields[$f->getId()] = $f;
Expand Down
2 changes: 1 addition & 1 deletion wa-system/validator/waUrlValidator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class waUrlValidator extends waRegexValidator

protected function init()
{
$this->setMessage('not_match', 'Invalid URL');
$this->setMessage('not_match', _ws('Invalid URL'));
$this->setPattern(self::REGEX_URL);
}

Expand Down
2 changes: 1 addition & 1 deletion wa-system/view/waAppViewHelper.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function pages($parent_id = 0, $with_params = true)
}
foreach ($page as $k => $v) {
if ($k != 'content') {
$page[$k] = htmlspecialchars($v);
$page[$k] = htmlspecialchars((string) $v);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion wa-system/view/waSmarty3View.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function assign($name, $value = null, $escape = false)
if (is_array($value)) {
$value = array_map('htmlspecialchars', $value);
} else {
$value = htmlspecialchars($value);
$value = htmlspecialchars((string) $value);
}
}
$this->smarty->assign($name, $value);
Expand Down
4 changes: 2 additions & 2 deletions wa-system/webasyst/lib/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
return array(
'name' => 'Webasyst',
'prefix' => 'webasyst',
'version' => '2.9.5',
'critical' => '2.9.5',
'version' => '2.9.6',
'critical' => '2.9.6',
'vendor' => 'webasyst',
'csrf' => true,
'header_items' => array(
Expand Down
3 changes: 3 additions & 0 deletions wa-system/webasyst/locale/ru_RU/LC_MESSAGES/webasyst.po
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,9 @@ msgstr "Email-адрес введен неправильно"
msgid "Invalid captcha"
msgstr "Капча введена неверно"

msgid "Invalid URL"
msgstr "URL введен неправильно"

msgid "Template settings"
msgstr "Настройки шаблона"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
[s`<strong>Enable secure sign-in with 2-factor authentication (2FA).</strong> Your account will be connected to Webasyst ID, and any sign-in attempts from new devices will be protected with an SMS confirmation code.`]
</p>
<form class="flexbox middle space-16">
<input type="tel" placeholder="[s`+1`]" class="solid bold" value="{$webasyst_id_auth_banner.phone|default:'[s`+1`]'}" style="background-color: var(--background-color-blank);">
<input type="tel" placeholder="[s`+1`]" class="solid bold" value="{$webasyst_id_auth_banner.phone|default:'[s`+1`]'|escape}" style="background-color: var(--background-color-blank);">
<button type="submit" class="button green">[s`Connect`]</button>
<a href="javascript:void(0);" class="js-webasyst-id-helplink small">[s`How does it work?`]</a>
<script>
Expand Down

0 comments on commit 0360582

Please sign in to comment.