@@ -296,29 +296,23 @@ function getUrlSatusCodesb($urlsb, $timeoutsb = 3)
296296 @endif
297297 @endif
298298 @elseif (env (' NOTIFY_UPDATES' ) == ' true' or env (' NOTIFY_UPDATES' ) === ' major' or env (' NOTIFY_UPDATES' ) === ' all' )
299- <?php // Checks if URL exists
300- try {
301- function URL_exists (string $urlsb ): bool
302- {
303- return str_contains (get_headers ($urlsb )[0 ], " 200 OK" );
304- }
305- // Sets $ServerExists to true if URL exists
306- if (URL_exists (" https://julianprieber.github.io/littlelink-custom/version.json" )){
307- $ServerExists = " true" ;
308- }
309- } catch (exception $e ) {
310- $ServerExists = " false" ;
311- }
312- ? >
313299
314300 <! –– Checks if file version.json exists AND if version.json exists on server to continue (without this PHP will throw ErrorException ) ––>
315- @if (file_exists (base_path (" version.json" )) and $ServerExists == ' true ' )
301+ @if (file_exists (base_path (" version.json" )) )
316302
317303 <?php // Requests newest version from server and sets it as variable
318- $Vgit = file_get_contents (" https://julianprieber.github.io/littlelink-custom/version.json" );
304+
305+ try {
306+ $Vgit = file_get_contents (" https://version.littlelink-custom.com/" );
319307
320308 // Requests current version from the local version file and sets it as variable
321- $Vlocal = file_get_contents (base_path (" version.json" ));
309+ $Vlocal = file_get_contents (base_path (" version.json" ));
310+ }
311+
312+ catch (Exception $e ){
313+ $Vgit = " 0" ;
314+ $Vlocal = " 0" ;
315+ }
322316 ? >
323317
324318 <! –– If user has role admin AND newest GitHub release version is higher than the local one an update notice will be displayed ––>
@@ -454,22 +448,10 @@ function copyText(text) {
454448@endif
455449
456450 <! –– #### begin event detection #### ––>
457- <?php
458- try {
459- function URL_event_exists (string $urlsb ): bool
460- {
461- return str_contains (get_headers ($urlsb )[0 ], " 200 OK" );
462- }
463- if (URL_event_exists (" https://julianprieber.github.io/littlelink-custom-events/event.json" )){
464- $EventServerExists = " true" ;
465- }
466- } catch (exception $e ) {
467- $EventServerExists = " false" ;
468- }
469- ? >
470- @if (env (' NOTIFY_EVENTS' ) === true and $EventServerExists == ' true' )
451+ @if (env (' NOTIFY_EVENTS' ) === true )
471452 <?php
472- $GetEventJson = file_get_contents (" https://julianprieber.github.io/littlelink-custom-events/event.json" );
453+ try {
454+ $GetEventJson = file_get_contents (" https://event.littlelink-custom.com/" );
473455 $EventJson = json_decode ($GetEventJson , true );
474456 if (isset ($_COOKIE [' HideEvent' ]) == NULL ) {
475457 setcookie (" HideEvent" ,$_COOKIE [' ID' ] = " 0" , time ()+ 60 * 60 * 24 * 5 , " /" );
@@ -504,6 +486,7 @@ function URL_event_exists(string $urlsb): bool
504486}
505487</script>
506488 @endif
489+ <?php } catch (Exception $e ){} ? >
507490@endif
508491 <! –– #### end event detection #### ––>
509492 @yield (' content' )
0 commit comments