From d250402a3c1797ad0fc10d99007c9a84df0caa6c Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 11 Aug 2024 17:22:04 +0200 Subject: [PATCH] functions.php: allow json API access from src.openmamba.org --- functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 186a1bf..54cee24 100644 --- a/functions.php +++ b/functions.php @@ -209,12 +209,13 @@ function openmamba_download_func( $atts ) { if (strpos(";".$a['archs'].";",$currarch) == false) continue; $ret .= openmamba_download_link($milestone,$medium,$currarch,$ext,$langs[$outputlang],$outputlang); } + $out .= ""; foreach ($langs as $l => $lang) { if ($l == $outputlang) continue; reset($archname); foreach($archname as $ey => $currarch) { if (strpos(";".$a['archs'].";",$currarch) == false) continue; - $out = openmamba_download_link($milestone,$medium,$currarch,$ext,$lang,$l); + $out .= openmamba_download_link($milestone,$medium,$currarch,$ext,$lang,$l); } } $ret .= do_shortcode("[expand title=\"". __("More languages...","responsive") . "\"]". $out ."[/expand]"); @@ -437,7 +438,7 @@ add_action('admin_init', 'wpb_imagelink_setup', 10); /* Security: restrict access to wp-json */ function restrict_rest_api_to_localhost() { - $whitelist = [ '127.0.0.1', "::1" ]; + $whitelist = [ '127.0.0.1', "::1", '176.9.120.93', '2a01:4f8:151:7444::1:3' ]; if( ! in_array($_SERVER['REMOTE_ADDR'], $whitelist ) ){ die( 'REST API is disabled.' );