Skip to content

Commit 18a6e4c

Browse files
committed
str2int -> digits2int
1 parent 2a5a50e commit 18a6e4c

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

resources/lib/UnityLDAP.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private function getCustomIDMappings(): array
163163
}
164164
$output_map = [];
165165
foreach ($output as [$uid, $uidNumber_str]) {
166-
$output_map[$uid] = str2int($uidNumber_str);
166+
$output_map[$uid] = digits2int($uidNumber_str);
167167
}
168168
return $output_map;
169169
}

resources/lib/utils.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,11 @@ function getHyperlink($text, ...$url_components)
9393
}
9494

9595
/**
96+
* negative numbers not allowed
9697
* extra args (ex: base) are passed along to intval()
9798
* @throws ValueError
9899
*/
99-
function str2int(string $x, ...$args): int
100+
function digits2int(string $x, ...$args): int
100101
{
101102
if (ctype_digit($x)) {
102103
return intval($x, ...$args);

webroot/api/content/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
require_once __DIR__ . "/../../../resources/autoload.php";
88

9-
$CHAR_WRAP = str2int(UnityHTTPD::getQueryParameter("line_wrap", false) ?? "80");
9+
$CHAR_WRAP = digits2int(UnityHTTPD::getQueryParameter("line_wrap", false) ?? "80");
1010
$content_name = UnityHTTPD::getQueryParameter("content_name");
1111
echo $SQL->getPage($content_name)["content"];

webroot/panel/account.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
break;
5454
case "delKey":
5555
$keys = $USER->getSSHKeys();
56-
$index = str2int(UnityHTTPD::getPostData("delIndex"));
56+
$index = digits2int(UnityHTTPD::getPostData("delIndex"));
5757
if ($index >= count($keys)) {
5858
break;
5959
}

0 commit comments

Comments
 (0)