currency: Do not run strip_tags on api.github.com output

The output of api.github.com is JSON, thus we should not remove every
<...> for it.  For example, strip_tags had trimmed the JSON for
shadow-4.14.1, leading to "Attempt to read property "tag_name" on null".
This commit is contained in:
Xi Ruoyao 2023-10-08 16:04:48 +08:00
parent d42ea8f08d
commit c39bfe9b33
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3

View File

@ -85,8 +85,9 @@ function http_get_file( $url )
exec( "curl --location --silent --max-time 30 $url", $dir );
$s = implode( "\n", $dir );
$dir = strip_tags( $s );
$dir = implode( "\n", $dir );
if ( !preg_match( "/api.github.com/", $url) )
$dir = strip_tags( $dir );
return explode( "\n", $dir );
}