Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#43 potential problem with php code

phpweather-2.x
open
PHP code (11)
5
2006-09-10
2006-04-04
bahrmann
No

I was wondering why I was not getting RH values with
version 2.2.2 Upon further investigation it appears
that it is not calculated unless
taken from phpweather.php

if (!empty($decoded_metar['temperature']['temp_c']) &&
!empty($decoded_metar['temperature']['dew_c'])) {

now my problem with this appears that when either temp
or dew is 0 then by php 4 definition
PHP 4

As of PHP 4, The string value "0" is considered empty.

and therefore rh is not calculated...should !empty be
replaced with isset

Discussion

  • Max Hammond
    Max Hammond
    2006-09-10

    • assigned_to: nobody --> kcornwell