@@ -236,29 +236,24 @@ function getUrlSatusCodesb($urlsb, $timeoutsb = 3)
236
236
@endif
237
237
@endif
238
238
@elseif (env (' NOTIFY_UPDATES' ) == ' true' or env (' NOTIFY_UPDATES' ) === ' major' or env (' NOTIFY_UPDATES' ) === ' all' )
239
- <?php // Checks if URL exists
240
- try {
241
- function URL_exists (string $urlsb ): bool
242
- {
243
- return str_contains (get_headers ($urlsb )[0 ], " 200 OK" );
244
- }
245
- // Sets $ServerExists to true if URL exists
246
- if (URL_exists (" https://julianprieber.github.io/littlelink-custom/version.json" )){
247
- $ServerExists = " true" ;
248
- }
249
- } catch (exception $e ) {
250
- $ServerExists = " false" ;
251
- }
252
- ? >
253
239
254
240
<! –– Checks if file version.json exists AND if version.json exists on server to continue (without this PHP will throw ErrorException ) ––>
255
- @if (file_exists (base_path (" version.json" )) and $ServerExists == ' true ' )
241
+ @if (file_exists (base_path (" version.json" )) )
256
242
257
243
<?php // Requests newest version from server and sets it as variable
258
- $Vgit = file_get_contents (" https://julianprieber.github.io/littlelink-custom/version.json" );
244
+
245
+ try {
246
+ $Vgit = file_get_contents (" https://version.littlelink-custom.com/" );
259
247
260
248
// Requests current version from the local version file and sets it as variable
261
249
$Vlocal = file_get_contents (base_path (" version.json" ));
250
+ }
251
+
252
+ catch (Exception $e ){
253
+ $Vgit = " 0" ;
254
+ $Vlocal = " 0" ;
255
+ }
256
+
262
257
? >
263
258
264
259
<! –– If user has role admin AND newest GitHub release version is higher than the local one an update notice will be displayed ––>
@@ -317,22 +312,10 @@ function URL_exists(string $urlsb): bool
317
312
@endif
318
313
319
314
<! –– #### begin event detection #### ––>
320
- <?php
321
- try {
322
- function URL_event_exists (string $urlsb ): bool
323
- {
324
- return str_contains (get_headers ($urlsb )[0 ], " 200 OK" );
325
- }
326
- if (URL_event_exists (" https://julianprieber.github.io/littlelink-custom-events/event.json" )){
327
- $EventServerExists = " true" ;
328
- }
329
- } catch (exception $e ) {
330
- $EventServerExists = " false" ;
331
- }
332
- ? >
333
- @if (env (' NOTIFY_EVENTS' ) === true and $EventServerExists == ' true' )
315
+ @if (env (' NOTIFY_EVENTS' ) === true )
334
316
<?php
335
- $GetEventJson = file_get_contents (" https://julianprieber.github.io/littlelink-custom-events/event.json" );
317
+ try {
318
+ $GetEventJson = file_get_contents (" https://event.littlelink-custom.com/" );
336
319
$EventJson = json_decode ($GetEventJson , true );
337
320
if (isset ($_COOKIE [' HideEvent' ]) == NULL ) {
338
321
setcookie (" HideEvent" ,$_COOKIE [' ID' ] = " 0" , time ()+ 60 * 60 * 24 * 5 , " /" );
@@ -367,6 +350,7 @@ function URL_event_exists(string $urlsb): bool
367
350
}
368
351
</script>
369
352
@endif
353
+ <?php } catch (Exception $e ){} ? >
370
354
@endif
371
355
<! –– #### end event detection #### ––>
372
356
@yield (' content' )
0 commit comments