about summary refs log tree commit diff
path: root/sourcecodes
AgeCommit message (Collapse)Author
6 daysMake all shell scripts executable. HEAD mainFrederick Muriuki Muriithi
The code needs the shell scripts to be executable, otherwise the code will raise an error (Permission Denied).
6 daysUse new `runTerminalCommand()` wrapper to run commands.Frederick Muriuki Muriithi
6 daysAdd a wrapper around `proc_open(...)` to use for terminal commands.Frederick Muriuki Muriithi
12 daysBugfix: Fix path.Frederick Muriuki Muriithi
12 daysBugfix: Check that key exists before use.Frederick Muriuki Muriithi
12 daysBugfix: Move variable closer to usage.Frederick Muriuki Muriithi
Initialise the `$TextFile` variable within the handling of the "POST" request rather than in the global scope.
13 daysFix undefined $TextinFile/$keyval in bn_after_upload_gom.phpClaude Sonnet 5
$TextinFile was passed to move_uploaded_file() as its $to argument, but its assignment (and the $keyval/$sid/$dir it depends on) was commented out, so $TextinFile was always null/undefined here -- an upload through this page could never succeed even on PHP 7.4, and on PHP 8.1+ it also triggers "Passing null to parameter #1 ($to)... is deprecated". $keyval was similarly used (e.g. in the hidden My_key form field) before it was ever assigned, causing an "Undefined variable" warning that could leak into an unquoted HTML attribute if display_errors is on. Unlike bn_file_load_gom.php (a fresh-upload entry point that mints a new random key), this page is only reached via a redirect from modify_structure_learning.php with an existing My_key already in the query string. Restored the commented-out block, adapted to read $keyval from $_GET (matching how the rest of this file already does it further down) instead of generating a new one, so $TextinFile is a real path before the upload block runs. Verified empirically against PHP 8.3.28: simulating an upload request now correctly reaches move_uploaded_file() with a real path and falls into the file's own pre-existing "Sorry, error uploading" handling instead of silently failing on a null argument. Reviewed by: Frederick M Muriithi <fredmanglis@gmail.com>
13 daysGuard arithmetic on file/shell-output-derived values against non-numeric stringsClaude Sonnet 5
PHP 8 throws a fatal TypeError for arithmetic (+ - * /) on a non-numeric string ("Unsupported operand types"); PHP 7.4 only warned and treated it as 0. Several files perform arithmetic directly on values parsed from intermediate state files (nnode.txt, nrows.txt, structure_input*.txt) or from `dot -Tplain` output, with no is_numeric() check — safe as long as those files are well-formed, but a crash risk if a file is missing/empty/truncated or a `dot` output line doesn't parse as expected. Affected: runtime_check.php ($node, $nrows), remove_variables.php and create_tiers_gom_part1.php ($maxplist=$node-1), mat_structure.php (matrix cell multiplication), and the four network_layout_{evd,inv}[,_2].php files ($r_index=$node+N and the dot-output-derived $cell arithmetic in the _2 variants). Fix pattern: coalesce to 0 via `is_numeric($x) ? $x : 0` before the arithmetic, matching PHP 7.4's original fallback-to-0 behavior instead of crashing. Verified empirically against PHP 8.3.28 with runtime_check.php and mat_structure.php: previously, a missing/empty source file caused TypeError: Unsupported operand types: string - int (or string * int) after the fix, the same missing-file scenario produces only the pre-existing "undefined array key" warnings (same as PHP 7.4) and the function completes and returns a value instead of crashing. Reviewed by: Frederick M Muriithi <fredmanglis@gmail.com>
13 daysGuard fopen() results with a false-check before fwrite/fprintf/fcloseClaude Sonnet 5
On PHP 7.4, calling fwrite()/fprintf()/fclose() with a false handle (a failed fopen(), e.g. from a bad path, missing directory, or permissions issue) just emits a warning and no-ops. On PHP 8.0+, these functions require a resource argument and throw an uncaught TypeError instead, turning what used to be a silent degradation into a fatal crash of the whole request. This patch wraps every fopen()-then-write call site in the codebase (18 files) with an `if ($handle !== false) { ... }` check, matching the existing pattern used elsewhere in the codebase. Where the same $fpvar handle is threaded through shared helper functions (enter_ban_list/banlist/whitelist, duplicated across remove_variables_processing.php, remove_variables_processing_default.php, modify_structure_learning.php and tier_description_processing_gom.php), the guard was added inside those functions too for consistency, even though the call sites are currently dead/commented-out in three of the four files — so the same landmine doesn't reappear if that code is ever re-enabled. Verified empirically against PHP 8.3.28: fopen() on an unwritable path followed by fwrite() on the resulting `false` throws TypeError: fwrite(): Argument #1 ($stream) must be of type resource, false given without the guard; with the guard, the call is skipped instead of crashing. The normal (successful fopen) path was also re-run through mat_structure.php's structure_change() and still produces identical output to before the change. Reviewed by: Frederick M Muriithi <fredmanglis@gmail.com>
13 daysGuard valid_keyval()/valid_input() against null input (PHP 8.1 deprecation)Claude Sonnet 5
These two functions are the single most common entry point in the codebase — ~30+ files call them as valid_keyval($_GET["My_key"]) or valid_input($_POST[...]) with no isset() guard at the call site. When the key is absent, PHP passes null straight into trim(), which is a non-nullable string parameter. As of PHP 8.1 this triggers a "Passing null to parameter #1 ($string) ... is deprecated" notice on every one of those call sites, on every request missing the param. Coalescing to '' inside the two functions themselves fixes this once, for every caller, instead of patching every call site individually. Verified empirically against PHP 8.3.28: valid_keyval(null) / valid_input(null) no longer emit the trim() deprecation notice and still return '' as before (same effective behavior as PHP 7.4). Reviewed by: Frederick M Muriithi <fredmanglis@gmail.com>
13 daysRemove orphaned fwrite() call in runtime_check.php that crashes on PHP 8Claude Sonnet 5
$fprows and $lc were never defined anywhere in exe_time(). On PHP 7.4 fwrite() with a null resource argument just emitted warnings and returned false. On PHP 8+, fwrite() requires a resource/false is no longer coerced, so this throws an uncaught TypeError on every call, crashing any page that invokes exe_time() (progress-tracking pages). Verified empirically against PHP 8.3.28: before the fix, calling exe_time() throws TypeError: fwrite(): Argument #1 ($stream) must be of type resource, null given after the fix it returns the computed runtime estimate as before. Reviewed by: Frederick M Muriithi <fredmanglis@gmail.com>
2021-10-11Update home.phpziejd2
2021-10-11Update layout_svg_no.phpziejd2
2021-10-11Resolved merge conflictziejd2
2021-10-08Update bn_genenet.phpziejd2
2021-10-08Add files via uploadziejd2
2021-10-08Add files via uploadziejd2
2021-10-08Update network_score.cziejd2
Fixed a potential bug with malloc.
2021-03-16Delete old example filesziejd2
2021-03-16Delete Bqxmap.txtziejd2
2021-03-16Delete Bqxk.txtziejd2
2021-03-16Delete Bqxgraphviz.txtziejd2
2021-03-16Delete standardized_data.txtziejd2
2021-03-16Delete Bqxcontinuous_input.txtziejd2
2021-03-16Delete Bqxban.txtziejd2
2021-03-16Delete sourcecodes/data/example1/old directoryziejd2
2021-03-09Update layout_svg_no.phpziejd2
2021-03-09Update prepareInput.mziejd2
2021-03-09Update upload_structure_file.phpziejd2
2021-03-04Create sample_network.jsonziejd2
2021-03-04Update layout_cyto.phpziejd2
2021-03-02Delete table.css~ziejd2
2021-03-02Delete font-awesome.css~ziejd2
2021-03-02Delete accordion.js~ziejd2
2021-03-02Delete create_table.js~ziejd2
2021-03-02Delete layout_cyto.php~ziejd2
2021-03-02Delete enter_netID.php~ziejd2
2021-03-02Delete .violin_plotly.py.swpziejd2
2021-03-02Delete sourcecodes/data/old directoryziejd2
2021-03-02Delete LRlnetwork.jsonziejd2
2021-03-02Delete net_structure.php.bkziejd2
2021-03-02Delete sourcecodes/localscore directoryziejd2
2021-03-02Delete sourcecodes/k-best directoryziejd2
2021-03-02Delete structureziejd2
2021-03-02Delete network_scoreziejd2
2021-03-02Delete build.shziejd2
2021-02-24Update upload_structure_file.phpziejd2
2021-02-24Update test_set_predictions.phpziejd2
2021-02-24Update remove_variables.phpziejd2
2021-02-24Update create_tiers_gom_part2.phpziejd2