Skip to content

Commit 90af0f1

Browse files
committed
incorporated the suggestions from PR #115 to update Twig
other minor changes
1 parent 1d07848 commit 90af0f1

File tree

12 files changed

+219
-67
lines changed

12 files changed

+219
-67
lines changed

common.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use UniFi_API\Client as ApiClient;
1212

13-
const TOOL_VERSION = '2.0.30';
13+
const TOOL_VERSION = '2.0.31';
1414

1515
/**
1616
* Gather some basic information for the About modal.

composer.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/custom.js

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ $('.output_radio_button').click(function() {
194194
*/
195195
function switchCSS(new_theme) {
196196
console.log('switching to new Bootswatch theme: ' + new_theme);
197-
if (new_theme == 'bootstrap') {
197+
if (new_theme === 'bootstrap') {
198198
$('#bootswatch_theme_stylesheet').attr('href', '');
199199
} else {
200200
$('#bootswatch_theme_stylesheet').attr('href', 'https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/' + new_theme + '/bootstrap.min.css');
@@ -317,7 +317,7 @@ function fetchDebugDetails() {
317317
url: 'ajax/show_api_debug.php',
318318
dataType: 'html',
319319
success: function (data) {
320-
if (data != 'ignore') {
320+
if (data !== 'ignore') {
321321
console.log('debug messages as returned by the cURL request to the UniFi controller API:');
322322
console.log(data);
323323
}
@@ -532,28 +532,37 @@ $(function() {
532532
* upon opening the "About" modal we check latest version of API browser tool using AJAX and inform user when it's
533533
* more recent than the current
534534
*/
535+
let version_update_span = $('#span_api_browser_update');
535536
$('#about_modal').on('shown.bs.modal', function (e) {
536537
$.ajax({
537538
type: 'GET',
538539
url: 'https://api.github.com/repos/Art-of-WiFi/UniFi-API-browser/releases/latest',
539540
dataType: 'json',
540541
success: function (json) {
541-
if (api_browser_version != '' && typeof(json.tag_name) !== 'undefined') {
542-
if (cmpVersion(api_browser_version, json.tag_name.substring(1)) < 0) {
543-
$('#span_api_browser_update').html('an update is available: ' + json.tag_name.substring(1));
542+
if (api_browser_version !== '' && typeof(json.tag_name) !== 'undefined') {
543+
const normalizedTagName = json.tag_name.startsWith('v') ? json.tag_name.substring(1) : json.tag_name;
544+
545+
if (debug) {
546+
console.log('API Browser Version:', api_browser_version);
547+
console.log('Normalized Tag Name:', normalizedTagName);
548+
console.log('Comparison Result:', cmpVersion(api_browser_version, normalizedTagName));
549+
}
550+
551+
if (cmpVersion(api_browser_version, normalizedTagName) < 0) {
552+
version_update_span.html('an update is available: ' + normalizedTagName);
544553
$('#span_api_browser_update').removeClass('badge-success').addClass('badge-warning');
545-
} else if (cmpVersion(api_browser_version, json.tag_name.substring(1)) === 0) {
546-
$('#span_api_browser_update').html('up to date');
547-
$('#span_api_browser_update').removeClass('badge-danger').addClass('badge-success');
554+
} else if (cmpVersion(api_browser_version, normalizedTagName) === 0) {
555+
version_update_span.html('up to date');
556+
version_update_span.removeClass('badge-danger').addClass('badge-success');
548557
} else {
549-
$('#span_api_browser_update').html('bleeding edge!');
550-
$('#span_api_browser_update').removeClass('badge-success').addClass('badge-danger');
558+
version_update_span.html('bleeding edge!');
559+
version_update_span.removeClass('badge-success').addClass('badge-danger');
551560
}
552561
}
553562
},
554563
error: function(jqXHR, textStatus, errorThrown) {
555-
$('#span_api_browser_update').html('error checking updates');
556-
$('#span_api_browser_update').removeClass('badge-success').addClass('badge-danger');
564+
version_update_span.html('error checking updates');
565+
version_update_span.removeClass('badge-success').addClass('badge-danger');
557566
console.log(jqXHR);
558567
}
559568
});

vendor/art-of-wifi/unifi-api-client/src/Client.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class Client
2121
{
2222
/** Constants. */
23-
const CLASS_VERSION = '1.1.99';
23+
const CLASS_VERSION = '1.1.100';
2424
const CURL_METHODS_ALLOWED = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'];
2525
const DEFAULT_CURL_METHOD = 'GET';
2626

@@ -2098,7 +2098,8 @@ public function list_hotspotop()
20982098
* @param int|null $up upload speed limit in kbps
20992099
* @param int|null $down download speed limit in kbps
21002100
* @param int|null $megabytes data transfer limit in MB
2101-
* @return array containing a single object which contains the create_time(stamp) of the voucher(s) created
2101+
* @return array|bool containing a single object/array which contains the create_time(stamp) of the voucher(s)
2102+
* created, false upon failure
21022103
*/
21032104
public function create_voucher(
21042105
int $minutes,
@@ -2108,7 +2109,7 @@ public function create_voucher(
21082109
int $up = null,
21092110
int $down = null,
21102111
int $megabytes = null
2111-
): array
2112+
)
21122113
{
21132114
$payload = [
21142115
'cmd' => 'create-voucher',

vendor/composer/installed.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
"packages": [
33
{
44
"name": "art-of-wifi/unifi-api-client",
5-
"version": "v1.1.99",
6-
"version_normalized": "1.1.99.0",
5+
"version": "v1.1.100",
6+
"version_normalized": "1.1.100.0",
77
"source": {
88
"type": "git",
99
"url": "https://github.com/Art-of-WiFi/UniFi-API-client.git",
10-
"reference": "70f6a374e2c73eb91a9aa20f6c9375b235d55ce1"
10+
"reference": "1522992e495f94b9fa52ff1015fe1e99f9a24fe4"
1111
},
1212
"dist": {
1313
"type": "zip",
14-
"url": "https://api.github.com/repos/Art-of-WiFi/UniFi-API-client/zipball/70f6a374e2c73eb91a9aa20f6c9375b235d55ce1",
15-
"reference": "70f6a374e2c73eb91a9aa20f6c9375b235d55ce1",
14+
"url": "https://api.github.com/repos/Art-of-WiFi/UniFi-API-client/zipball/1522992e495f94b9fa52ff1015fe1e99f9a24fe4",
15+
"reference": "1522992e495f94b9fa52ff1015fe1e99f9a24fe4",
1616
"shasum": ""
1717
},
1818
"require": {
1919
"ext-curl": "*",
2020
"ext-json": "*",
2121
"php": ">=7.4.0"
2222
},
23-
"time": "2024-10-23T11:30:34+00:00",
23+
"time": "2024-10-29T11:14:00+00:00",
2424
"type": "library",
2525
"installation-source": "source",
2626
"autoload": {
@@ -51,7 +51,7 @@
5151
],
5252
"support": {
5353
"issues": "https://github.com/Art-of-WiFi/UniFi-API-client/issues",
54-
"source": "https://github.com/Art-of-WiFi/UniFi-API-client/tree/v1.1.99"
54+
"source": "https://github.com/Art-of-WiFi/UniFi-API-client/tree/v1.1.100"
5555
},
5656
"install-path": "../art-of-wifi/unifi-api-client"
5757
},
@@ -531,17 +531,17 @@
531531
},
532532
{
533533
"name": "twig/twig",
534-
"version": "v3.11.1",
535-
"version_normalized": "3.11.1.0",
534+
"version": "v3.11.3",
535+
"version_normalized": "3.11.3.0",
536536
"source": {
537537
"type": "git",
538538
"url": "https://github.com/twigphp/Twig.git",
539-
"reference": "ff063afc691e1cfda6714f1915ed766cb108d188"
539+
"reference": "3b06600ff3abefaf8ff55d5c336cd1c4253f8c7e"
540540
},
541541
"dist": {
542542
"type": "zip",
543-
"url": "https://api.github.com/repos/twigphp/Twig/zipball/ff063afc691e1cfda6714f1915ed766cb108d188",
544-
"reference": "ff063afc691e1cfda6714f1915ed766cb108d188",
543+
"url": "https://api.github.com/repos/twigphp/Twig/zipball/3b06600ff3abefaf8ff55d5c336cd1c4253f8c7e",
544+
"reference": "3b06600ff3abefaf8ff55d5c336cd1c4253f8c7e",
545545
"shasum": ""
546546
},
547547
"require": {
@@ -556,7 +556,7 @@
556556
"psr/container": "^1.0|^2.0",
557557
"symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0"
558558
},
559-
"time": "2024-09-10T10:40:14+00:00",
559+
"time": "2024-11-07T12:34:41+00:00",
560560
"type": "library",
561561
"installation-source": "dist",
562562
"autoload": {
@@ -598,7 +598,7 @@
598598
],
599599
"support": {
600600
"issues": "https://github.com/twigphp/Twig/issues",
601-
"source": "https://github.com/twigphp/Twig/tree/v3.11.1"
601+
"source": "https://github.com/twigphp/Twig/tree/v3.11.3"
602602
},
603603
"funding": [
604604
{

vendor/composer/installed.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'name' => '__root__',
44
'pretty_version' => 'dev-master',
55
'version' => 'dev-master',
6-
'reference' => '2aa4eacd2a3939191239784be9a1f9a622eb5db1',
6+
'reference' => '1d0784845357ba781472c9ea6b6dd07ba870cae3',
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -13,16 +13,16 @@
1313
'__root__' => array(
1414
'pretty_version' => 'dev-master',
1515
'version' => 'dev-master',
16-
'reference' => '2aa4eacd2a3939191239784be9a1f9a622eb5db1',
16+
'reference' => '1d0784845357ba781472c9ea6b6dd07ba870cae3',
1717
'type' => 'library',
1818
'install_path' => __DIR__ . '/../../',
1919
'aliases' => array(),
2020
'dev_requirement' => false,
2121
),
2222
'art-of-wifi/unifi-api-client' => array(
23-
'pretty_version' => 'v1.1.99',
24-
'version' => '1.1.99.0',
25-
'reference' => '70f6a374e2c73eb91a9aa20f6c9375b235d55ce1',
23+
'pretty_version' => 'v1.1.100',
24+
'version' => '1.1.100.0',
25+
'reference' => '1522992e495f94b9fa52ff1015fe1e99f9a24fe4',
2626
'type' => 'library',
2727
'install_path' => __DIR__ . '/../art-of-wifi/unifi-api-client',
2828
'aliases' => array(),
@@ -83,9 +83,9 @@
8383
'dev_requirement' => false,
8484
),
8585
'twig/twig' => array(
86-
'pretty_version' => 'v3.11.1',
87-
'version' => '3.11.1.0',
88-
'reference' => 'ff063afc691e1cfda6714f1915ed766cb108d188',
86+
'pretty_version' => 'v3.11.3',
87+
'version' => '3.11.3.0',
88+
'reference' => '3b06600ff3abefaf8ff55d5c336cd1c4253f8c7e',
8989
'type' => 'library',
9090
'install_path' => __DIR__ . '/../twig/twig',
9191
'aliases' => array(),

vendor/twig/twig/CHANGELOG

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 3.11.3 (2024-11-07)
2+
3+
* Fix an infinite recursion in the sandbox code
4+
5+
# 3.11.2 (2024-11-06)
6+
7+
* [BC BREAK] Fix a security issue in the sandbox mode allowing an attacker to call attributes on Array-like objects
8+
They are now checked via the property policy
9+
* Fix a security issue in the sandbox mode allowing an attacker to be able to call `toString()`
10+
under some circumstances on an object even if the `__toString()` method is not allowed by the security policy
11+
112
# 3.11.1 (2024-09-10)
213

314
* Fix a security issue when an included sandboxed template has been loaded before without the sandbox context

vendor/twig/twig/src/Environment.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
*/
4444
class Environment
4545
{
46-
public const VERSION = '3.11.1';
47-
public const VERSION_ID = 301101;
46+
public const VERSION = '3.11.3';
47+
public const VERSION_ID = 301103;
4848
public const MAJOR_VERSION = 4;
4949
public const MINOR_VERSION = 11;
50-
public const RELEASE_VERSION = 1;
50+
public const RELEASE_VERSION = 3;
5151
public const EXTRA_VERSION = '';
5252

5353
private $charset;

0 commit comments

Comments
 (0)