Skip to content

Commit

Permalink
Fix bug: Didn't create php start tag for cache
Browse files Browse the repository at this point in the history
  • Loading branch information
AunePVP committed Jul 1, 2022
1 parent 45fad38 commit 02aae14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ function minecraftcache($username) {
$data = json_decode(file_get_contents("https://api.mojang.com/users/profiles/minecraft/$username"));
$uuid = $data->id;
$data = '$mcuuid[\''.$username.'\'] = "'. $uuid .'";';
file_put_contents("query/cron/cache/minecraft.php", $data . "\n", FILE_APPEND);
if (!file_exists("query/cron/cache/minecraft.php")) {
file_put_contents("query/cron/cache/minecraft.php", "<?php\n".$data."\n", FILE_APPEND);
} else {
file_put_contents("query/cron/cache/minecraft.php", $data . "\n", FILE_APPEND);
}
return $uuid;
} else {
return $mcuuid[$username];
Expand Down

0 comments on commit 02aae14

Please sign in to comment.