From c39bfe9b33f371f9623b5eaa5e030ec2ebedad11 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 8 Oct 2023 16:04:48 +0800 Subject: [PATCH] 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". --- lfs-latest-git.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lfs-latest-git.php b/lfs-latest-git.php index c0c7aaea3..6894b4a9e 100644 --- a/lfs-latest-git.php +++ b/lfs-latest-git.php @@ -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 ); }