Author Topic: get-meteoalarm-warning-inc.php : https  (Read 840 times)

0 Members and 1 Guest are viewing this topic.

Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
get-meteoalarm-warning-inc.php : https
« on: September 22, 2018, 06:50:39 AM »
Hi,
running :
Code: [Select]
World get-meteoalarm-warning-inc.php Current V2.10 - 2018-07-22 V2.10 - 2018-07-22 get-meteoalarm-warning-inc.php V2.10 - 22-Jul-2018
Saw I got a yellow triangle about https (saw  it only now)
had to change http to https in following line :

Code: [Select]
     if ($doDebug) { print "<!-- rawWarning ='$rawWarning' \n WarnColor='$WarnColor' -->\n"; }
$EUAwarning .= "<tr>\n";
preg_match('|<img src="(.*)"|',$rawWarning,$matches);

$warnImg = "https://" . $EUA_hostname . $matches[1];              // this line

if ($doDebug) { print "<!-- warnImg ='$warnImg' -->\n"; }
preg_match_all('|<div class="([^"]+)".*>(.*)</div>|Uis',$rawWarning,$matches);
     if($doDebug) { print "<!-- detail matches \n".print_r($matches,true)." -->\n"; }
$warnTxt = '';
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: get-meteoalarm-warning-inc.php : https
« Reply #1 on: September 22, 2018, 10:41:12 PM »
Thanks for spotting that.  I'll bundle the change into an upcoming fix release.
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

Offline jachen

  • Member
  • *
  • Posts: 39
    • Neue Wetterstation Widen
Re: get-meteoalarm-warning-inc.php : https
« Reply #2 on: December 15, 2018, 01:43:14 PM »
Code: [Select]
preg_match('|<img src="(.*)"|',$rawWarning,$matches);
 
This worked for me:   

$warnImg = "http://" . $EUA_hostname . $matches[1];
         // Watch out for https on Image on the next line (jachen 15.12.2018)
         $warnImg = str_replace('http://','https://',$warnImg); // force HTTPS access on Image

 

anything