Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions html/inc/db.inc
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ function db_init_aux($try_replica=false) {
if ($x) $db_name = $x;
}
}
if ($host == null) {
if (is_blank($host)) {
$host = parse_config($config, "<db_host>");
}
if ($host == null) {
if (is_blank($host)) {
$host = "localhost";
}
if (1) {
Expand Down
7 changes: 7 additions & 0 deletions html/inc/util_basic.inc
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ function time_diff($x, $res=3) {
return $s;
}

// is the arg either null, '', or whitespace?
// Note: if ($x) will be false if $x is '0'.
// We don't want to treat '0' as blank.
//
function is_blank($x) {
return $x === null || trim($x) === '';
}

// security vulnerabilities and user-supplied strings:
// sources:
Expand Down
2 changes: 1 addition & 1 deletion html/inc/util_ops.inc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function db_init_cli() {
$config = get_config();
$db_name = parse_config($config, "<db_name>");
$host = parse_config($config, "<db_host>");
if ($host == null) {
if (is_blank($host)) {
$host = "localhost";
}
$in = fopen("php://stdin","r");
Expand Down
92 changes: 0 additions & 92 deletions html/ops/analyze_coproc_log.php

This file was deleted.

2 changes: 1 addition & 1 deletion html/ops/cancel_workunits.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
admin_page_head("Cancel Jobs");

$limit = get_int('limit', true);
if (!$limit || $limit==0) {
if (!$limit) {
$limit = 100;
}

Expand Down
2 changes: 1 addition & 1 deletion html/ops/fix_project_prefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function repair_prefs($prefs) {
}

$root = $prefs_dom->firstChild;
if ($root->hasChildNodes()) {
if ($root && $root->hasChildNodes()) {
$subNodes = $root->childNodes;
$to_remove = array();
foreach ($subNodes as $subNode) {
Expand Down
123 changes: 0 additions & 123 deletions html/ops/grant_credit.php

This file was deleted.

2 changes: 1 addition & 1 deletion html/ops/nvidia.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// script for studying NVIDIA GPUs on hosts

DEPRECATED: we don't use host.serialnum anymore
TODO: use host.misc instead of host.serialnum
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: TODO: text was added as executable PHP instead of a comment, which causes a parse error. Prefix it with comment syntax.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At html/ops/nvidia.php, line 21:

<comment>`TODO:` text was added as executable PHP instead of a comment, which causes a parse error. Prefix it with comment syntax.</comment>

<file context>
@@ -18,7 +18,7 @@
 // script for studying NVIDIA GPUs on hosts
 
-DEPRECATED: we don't use host.serialnum anymore
+TODO: use host.misc instead of host.serialnum
 
 $cli_only = true;
</file context>
Suggested change
TODO: use host.misc instead of host.serialnum
// TODO: use host.misc instead of host.serialnum
Fix with Cubic

Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line TODO: use host.misc instead of host.serialnum is not a PHP comment and will cause a parse error if this script is executed. Prefix this with // (or convert it to a block comment) so the file remains syntactically valid.

Suggested change
TODO: use host.misc instead of host.serialnum
// TODO: use host.misc instead of host.serialnum

Copilot uses AI. Check for mistakes.

$cli_only = true;
require_once("../inc/util_ops.inc");
Expand Down
Loading