Author Topic: Saratoga get-metar-conditions-inc.php PHP error (minor)  (Read 659 times)

0 Members and 1 Guest are viewing this topic.

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Saratoga get-metar-conditions-inc.php PHP error (minor)
« on: October 16, 2017, 03:07:57 PM »
This is one that's apparently been there a while but I never hit the error condition before.

Code: [Select]
      if (!preg_match('|200 |', $RC)) {
        $t = array(
          "unable to load $icao data RC=$RC",
          5,
          'day_partly_cloudy.gif',
          "unable to load $icao data RC=$RC",
          array() ,
          $metarGMT
        );
        $Debug.= "<!-- mtr_conditions returns RC='" . $RC . "' for ICAO/METAR='$icao' -->\n";
        return $t;
      }

The problem is that $metarGMT isn't set (only gets set below after successful METAR fetch).  Going to just set to zero for now...


https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga get-metar-conditions-inc.php PHP error (minor)
« Reply #1 on: October 16, 2017, 03:38:02 PM »
Thanks for finding that Notice: erratum -- yes, setting to 0 (zero) instead is appropriate.  I'll incorporate that for a future rev.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP