fix(weathermap): correct 12 rendering and config logic bugs#226
Merged
TheWitness merged 6 commits intoMay 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR targets several rendering, formatting, and configuration-handling bugs in the PHP Network Weathermap plugin, primarily in map serialization, legend drawing, curve calculation, and coverage loading.
Changes:
- Corrects swapped tooltip width/height serialization for nodes and links.
- Updates formatting, config parsing, legend rendering, and coverage-loading logic.
- Renames an editor loop variable for node inheritance handling.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
lib/WeatherMapNode.class.php |
Corrects node overlib width/height output in JS/JSON serialization. |
lib/WeatherMapLink.class.php |
Corrects link overlib width/height output in JS/JSON serialization. |
lib/WeatherMap.functions.php |
Updates %k/time formatting and curve point merging logic. |
lib/WeatherMap.class.php |
Updates legend color references, config detection, cache warning text, and coverage loading. |
lib/editor.inc.php |
Renames the node inheritance iterator variable. |
This was referenced May 17, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…k, scale_ref isset Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…turn, chdir not dir Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…egex spec Use (0,0) as origin for all drawing inside scale_im temp image; map position applies only at the imagecopy destination. Drop catmull-rom span initializer via array_slice to prevent out-of-order control point. Escape preg_replace_callback spec with preg_quote so a decimal in the format string does not match any character in the pattern. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Add realpath-based directory containment guard to SaveCoverage matching the existing LoadCoverage pattern. Wrap legend title myimagestring call in isset check for KEYTEXT scale_ref key to prevent undefined-index notice when AllocateScaleColours omits a key for non-default scales. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
1d8762d to
9739e98
Compare
TheWitness
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
overlibwidth/overlibheightvalues inasJS()andasJSON()for links and nodesarray_merge+array_slice($newpoints, 1)for curve-point arrays: the previous union operator dropped key 0 (the previous control point needed for the next span calculation), causing malformed curves on multi-span linkspreg_replacearguments in%kformat handler; usepreg_replace_callbackwithpreg_quote($spec, '/')to prevent backreference expansion and dot-matches-any$joincharassignment: dash flag now sets'-', not' '$this->configFile→$this->configfile(PHP property name case)$scale_imuse local (0,0)-based coords;$boxx/$boxyare the map-level copy destination, not the draw originreturn 0at top ofLoadCoverage()that suppressed all file I/O; add path guard andexplodecount check; add matching path-traversal guard toSaveCoverage()gdref1hardcoded key →$scale_refinDrawLegend_Vertical; addisset()guards onKEYTEXT[$scale_ref]strchr != false→!== falsein header injection check$link_name→$node_nameineditor.inc.phpTest plan
overlibwidth/overlibheightset and verify tooltip dimensions are correct%kbandwidth formatting display correct values