Skip to content

Commit cc3f4e9

Browse files
authored
v5.3.1
## v5.3.1 Bug fixes since v5.3.0. ### Bug fixes - Fix `getMinFilePerms()` broken octal comparison — always returned false, breaking plugin permission checks (@xirvik, fixes #3005, #2987) - Fix Chrome click-to-sort — phantom mousemove events caused column drag instead of sort (@xirvik, fixes #3001) - Fix filedrop drag from Firefox download panel — prefer file item over URL when both present (@xirvik, fixes #2966) - Restore `./` entry in directory picker dropdown — lost during 5.2.x refactor (@xirvik, fixes #3002) - Fix log_history: clear button now also clears saved history, null-safe stripTimestamp (@xirvik, fixes #3029) - Fix log_history: use DOM node manipulation instead of innerHTML, allow duplicate messages (@xirvik, inspired by #3030 from @ranirahn) - Remove noisy check_port error_log on servers without IPv6 (@xirvik) - Bundle GeoIP2 library as phar v2.13.0, remove composer dependency (@xirvik, fixes #3028) - Route d.tracker_announce through trusted httprpc handler for rtorrent 0.16.8 (@xirvik) ### PHP compatibility - Fix PHP 8.5 deprecations: `(integer)` cast and backtick operator (@xirvik, fixes #2992)
2 parents 87315d6 + 33c44da commit cc3f4e9

15 files changed

Lines changed: 71 additions & 37 deletions

File tree

js/stable.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ dxSTable.prototype.create = function(ele, styles, aName)
166166
if (this.isResizing) {
167167
this.colDragResize(ev);
168168
} else {
169+
if (ev.originalEvent.movementX === 0 && ev.originalEvent.movementY === 0) return;
169170
this.isMoving = true;
170171
this.isSorting = false;
171172
this.colDragMove(ev);

php/settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public function getScheduleCommand($name,$interval,$cmd,&$startAt = null) // $in
358358
$schedule_rand = 10;
359359
$tm = getdate();
360360
$startAt = mktime($tm["hours"],
361-
((integer)($tm["minutes"]/$interval))*$interval+$interval,
361+
((int)($tm["minutes"]/$interval))*$interval+$interval,
362362
0,$tm["mon"],$tm["mday"],$tm["year"])-$tm[0]+rand(0,$schedule_rand);
363363
if($startAt<0)
364364
$startAt = 0;

php/utility/fileutil.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,12 @@ public static function toLog( $str )
256256
}
257257
}
258258

259-
public static function getMinFilePerms( $file, $chmod = 755 )
259+
public static function getMinFilePerms( $file, $chmod = 0755 )
260260
{
261261
$code = fileperms($file);
262262

263263
if($code!==false)
264-
return((decoct($code) & 0777) >= $chmod);
264+
return(($code & 0777) >= $chmod);
265265

266266
return false;
267267
}

plugins/_cloudflare/cloudflare.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function process()
5454
}
5555
$code = escapeshellarg(Utility::getExternal('python'))." -c ".
5656
escapeshellarg("import cloudscraper\nimport json\ntokens, user_agent = cloudscraper.get_tokens({$url}{$proxies}{$recaptcha})\nprint(json.dumps([tokens,user_agent]))");
57-
$data = `{$code}`;
57+
$data = shell_exec($code);
5858
if($data &&
5959
($data = json_decode($data,true)) &&
6060
is_array($data) &&

plugins/_getdir/init.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,15 @@ theWebUI.rDirBrowser = class {
141141
this.frame.find(".rmenuobj").remove();
142142
this.frame.append(
143143
$("<div>").addClass("rmenuobj").append(
144+
$("<div>").addClass("rmenuitem").text("./"),
144145
...res.directories.map(ele => $("<div>").addClass("rmenuitem").text(ele + "/")),
145146
...(this.withFiles ? res.files : []).map(ele => $("<div>").addClass("rmenuitem").text(ele)),
146147
),
147148
);
148149
this.frame.find(".rmenuitem").on(
149150
"click", (ev) => this.selectItem(ev)
150151
).on(
151-
"dblclick", (ev) => (ev.currentTarget.innerText.endsWith("/")) ? this.requestDir() : this.hide()
152+
"dblclick", (ev) => (ev.currentTarget.innerText === "./") ? this.hide() : (ev.currentTarget.innerText.endsWith("/")) ? this.requestDir() : this.hide()
152153
);
153154
},
154155
error: (res) => console.log(res),
@@ -159,7 +160,10 @@ theWebUI.rDirBrowser = class {
159160
selectItem(ev) {
160161
this.frame.find(".rmenuitem.active").removeClass("active");
161162
$(ev.currentTarget).addClass("active");
162-
this.edit.val(this.edit.data("cwd") + ev.target.innerText);
163+
if (ev.target.innerText === "./")
164+
this.edit.val(this.edit.data("cwd"));
165+
else
166+
this.edit.val(this.edit.data("cwd") + ev.target.innerText);
163167
}
164168

165169
show() {

plugins/check_port/action.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ function get_public_ip($version, $timeout) {
4242
if (filter_var($ip, FILTER_VALIDATE_IP, $flag)) {
4343
return $ip; // Return the valid IP
4444
}
45-
error_log("check_port plugin: {$url} returned invalid IP: " . $ip);
4645
} else {
47-
error_log("check_port plugin: Failed to fetch from {$url}. Status: {$snoopy->status}, Error: {$snoopy->error}");
4846
}
4947
return null; // Return null on failure
5048
}

plugins/filedrop/init.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ plugin.onLangLoaded = function()
1515
// gets called before filedrop's handler.
1616

1717
const items = [...event.originalEvent.dataTransfer.items];
18+
// If a file is present, let the filedrop plugin handle it
19+
const hasFile = items.some(item => item.kind === "file");
20+
if (hasFile)
21+
return true;
1822
// find text/uri-list; if not found, find text/plain
1923
const uriList = items.find(item =>
2024
item.kind === "string" &&

plugins/geoip/conf.php

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
<?php
2-
// configuration parameters
2+
// GeoIP2 Plugin Configuration
3+
//
4+
// This plugin requires MaxMind GeoLite2 or GeoIP2 database files (.mmdb).
5+
// The GeoIP2 PHP library is bundled (no additional installation needed).
6+
//
7+
// Setup:
8+
// 1. Register for a free MaxMind account: https://www.maxmind.com/en/geolite2/signup
9+
// 2. Download GeoLite2-City.mmdb (and optionally GeoLite2-ASN.mmdb)
10+
// 3. Place them in /usr/share/GeoIP/ or update the paths below
11+
// 4. For automatic updates, install geoipupdate: https://github.com/maxmind/geoipupdate
312

4-
$retrieveCountry = true;
5-
$retrieveHost = true;
6-
$retrieveComments = true;
13+
$retrieveCountry = true;
14+
$retrieveHost = true;
15+
$retrieveComments = true;
716

8-
// For retrieve hosts
17+
// DNS resolver for reverse hostname lookups (null = system default)
18+
$dnsResolver = '1.1.1.1';
19+
$dnsResolverTimeout = 1; // timeout in seconds
920

10-
$dnsResolver = '1.1.1.1'; // use gethostbyaddr, if null
11-
$dnsResolverTimeout = 1; // timeout in seconds
12-
13-
// GeoIP2 MaxMindDB configuration
14-
$geoip2Autoloader = '/usr/local/share/GeoIP/vendor/autoload.php';
15-
$geoip2CityDb = '/usr/local/share/GeoIP/GeoIP2-City.mmdb';
16-
$geoip2IspDb = '/usr/local/share/GeoIP/GeoIP2-ISP.mmdb';
21+
// GeoIP2 database paths
22+
$geoip2CityDb = '/usr/share/GeoIP/GeoLite2-City.mmdb';
23+
$geoip2IspDb = '/usr/share/GeoIP/GeoLite2-ASN.mmdb';

plugins/geoip/geoip2.phar

513 KB
Binary file not shown.

plugins/geoip/init.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
eval( FileUtil::getPluginConf( $plugin["name"] ) );
66

7-
// GeoIP2: check that the autoloader and at least the city database exist
7+
// GeoIP2: check that the bundled library and at least the city database exist
88
$geoip2Available = (
9-
isset($geoip2Autoloader) && file_exists($geoip2Autoloader) &&
9+
file_exists(dirname(__FILE__).'/geoip2.phar') &&
1010
isset($geoip2CityDb) && file_exists($geoip2CityDb)
1111
);
1212
$retrieveCountry = ($retrieveCountry && $geoip2Available);

0 commit comments

Comments
 (0)