Skip to content

Commit

Permalink
Set file_get_contents timeout to 6 secs.
Browse files Browse the repository at this point in the history
  • Loading branch information
necro-nemesis committed Jun 22, 2022
1 parent 0a592cc commit 4708e06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ function DisplayLokinetConfig()
<input type="text" class="form-control" list="exitaddresses" placeholder="enter exit address here" id="exitaddress" name="exitaddress" onchange="OnSelectionChange()">
<?php $api_url = 'https://my-json-server.typicode.com/necro-nemesis/exits-api/exits';
// Read JSON file
$json_data = file_get_contents($api_url);
$json_data = file_get_contents($api_url, 0, stream_context_create(["http"=>["timeout"=>6]]));
// Decode JSON data into PHP array
$response_data = json_decode($json_data,true);
?>
Expand Down

0 comments on commit 4708e06

Please sign in to comment.