Sicherstellen dass die Links zu APOD Bildern weiterhin funktionieren und keine 404 Not Found-Verlinkungen entstehen.
APOD Domain Migration Impact
(apod.nasa.gov → science.nasa.gov/apod)
Maps how the NASA APOD base URL flows from environment config through PHP constants into the fetch/build logic and template rendering. Key affected spots: [1b] and [2c] (hardcoded/env URL), [2d] archive URL builder, [2e] malformed-URL workaround.
1. Env vars → PHP constants
Configuration layer: how NASA_APOD_SOURCE/API env vars become APOD_SOURCE/APOD_API constants used app-wide.
1a. API endpoint env var (.env.example:149)
Uses api.nasa.gov domain — unaffected by the announced migration
NASA_APOD_API="https://api.nasa.gov/planetary/apod?api_key=${NASA_API_KEY}"
1b. APOD source base URL env var (.env.example:150)
The value that must be updated to https://science.nasa.gov/apod
NASA_APOD_SOURCE="https://apod.nasa.gov/apod/"
1c. APOD_SOURCE constant defined (config.inc.php:316)
Maps env var into constant consumed by apod.inc.php; no code change needed here
if (!defined('APOD_SOURCE')) define('APOD_SOURCE', (isset($_ENV['NASA_APOD_SOURCE']) ? $_ENV['NASA_APOD_SOURCE'] : null));
1d. APOD_API constant defined (config.inc.php:317)
Maps API endpoint env var; separate domain, unaffected
if (!defined('APOD_API')) define('APOD_API', (isset($_ENV['NASA_APOD_API']) ? $_ENV['NASA_APOD_API'] : null));
2. get_apod() fetch & URL construction
Core business logic: fetches today's APOD from NASA API, fixes a known malformed-URL bug, and builds the archive link — all domain-dependent.
2a. Fetch APOD JSON from NASA API (apod.inc.php:63)
Calls api.nasa.gov via APOD_API constant; returns hdurl/url fields that reference apod.nasa.gov
$apod_data = cURLfetchJSON(APOD_API . (!empty($apod_date_input) ? '&date='.$apod_date_input : ''));
2b. Example API response (doc comment) (apod.inc.php:77)
Illustrates the malformed double-prefixed URL bug this code works around
[hdurl] => https://apod.nasa.gov/apod/http://nusoft.fnal.gov/...
2c. Hardcoded malformed-URL fix (small img) (apod.inc.php:92)
Hardcoded old domain string — must be verified/updated for new domain's bug behavior
$new_apod_img_small = str_replace('https://apod.nasa.gov/apod/http', 'http', $apod_data['url']);
2d. Hardcoded malformed-URL fix (large img) (apod.inc.php:93)
Same hardcoded domain workaround applied to hdurl field
$new_apod_img_large = str_replace('https://apod.nasa.gov/apod/http', 'http', $apod_data['hdurl']);
2e. Build archive URL from APOD_SOURCE (apod.inc.php:94)
Uses APOD_SOURCE constant + date pattern — path structure must match new science.nasa.gov/apod site
$new_apod_archive_url = APOD_SOURCE . 'ap'.$new_apod_date.'.html';
2f. Archive URL embedded into posted comment (apod.inc.php:275)
Archive link is stored permanently in the comment text posted to the gallery pic
$new_apod_comment = t('apod-pic-comment', 'apod', [ ... $new_apod_archive_url, ... ]);
3. Template rendering of stored APOD data
Presentation layer: how already-fetched/stored APOD data (independent of live NASA domain) gets displayed on the gallery overview page.
3a. Template tag invokes APOD block (overview.tpl:18)
Smarty template calls the registered {apod} function to render latest APOD thumbnail
3b. Registers {apod} tag to smarty_apod() (smarty.fnc.php:1659)
Smarty function registration table maps template tag to PHP handler
'apod' => [ 'smarty_apod', 'apod', 'APOD', 'Astronomy Picture of the Day (APOD)', false, false ]
3c. smarty_apod() reads DB, formats thumbnail (smarty.fnc.php:784)
Fetches latest stored APOD pic ID from DB — no live NASA domain reference here, unaffected by migration
$rs = get_apod_id(); return formatGalleryThumb($rs);
Describe the solution you'd like
Die APOD Website wird / wurde migriert: nasa/apod-api/issues/172
Reasons why we need it
Neue APOD Website ist bereits online, Migration läuft "between August to September (2026)"...
Sicherstellen dass die Links zu APOD Bildern weiterhin funktionieren und keine 404 Not Found-Verlinkungen entstehen.
Additional context
Kurzanalyse der zorgch/zorg-code Codebase auf relevante Anpassungen, mittels DeepWiki Devin:
https://deepwiki.com/search/the-apod-base-url-to-apod-imag_22d0b7fc-dbc5-433b-9067-3a0004bb8f97?mode=fast
APOD Domain Migration Impact
(apod.nasa.gov → science.nasa.gov/apod)
Maps how the NASA APOD base URL flows from environment config through PHP constants into the fetch/build logic and template rendering. Key affected spots: [1b] and [2c] (hardcoded/env URL), [2d] archive URL builder, [2e] malformed-URL workaround.
1. Env vars → PHP constants
Configuration layer: how NASA_APOD_SOURCE/API env vars become APOD_SOURCE/APOD_API constants used app-wide.
1a. API endpoint env var (
.env.example:149)Uses api.nasa.gov domain — unaffected by the announced migration
1b. APOD source base URL env var (
.env.example:150)The value that must be updated to https://science.nasa.gov/apod
1c. APOD_SOURCE constant defined (
config.inc.php:316)Maps env var into constant consumed by apod.inc.php; no code change needed here
1d. APOD_API constant defined (
config.inc.php:317)Maps API endpoint env var; separate domain, unaffected
2. get_apod() fetch & URL construction
Core business logic: fetches today's APOD from NASA API, fixes a known malformed-URL bug, and builds the archive link — all domain-dependent.
2a. Fetch APOD JSON from NASA API (
apod.inc.php:63)Calls api.nasa.gov via APOD_API constant; returns hdurl/url fields that reference apod.nasa.gov
2b. Example API response (doc comment) (
apod.inc.php:77)Illustrates the malformed double-prefixed URL bug this code works around
2c. Hardcoded malformed-URL fix (small img) (
apod.inc.php:92)Hardcoded old domain string — must be verified/updated for new domain's bug behavior
2d. Hardcoded malformed-URL fix (large img) (
apod.inc.php:93)Same hardcoded domain workaround applied to hdurl field
2e. Build archive URL from APOD_SOURCE (
apod.inc.php:94)Uses APOD_SOURCE constant + date pattern — path structure must match new science.nasa.gov/apod site
2f. Archive URL embedded into posted comment (
apod.inc.php:275)Archive link is stored permanently in the comment text posted to the gallery pic
3. Template rendering of stored APOD data
Presentation layer: how already-fetched/stored APOD data (independent of live NASA domain) gets displayed on the gallery overview page.
3a. Template tag invokes APOD block (
overview.tpl:18)Smarty template calls the registered {apod} function to render latest APOD thumbnail
3b. Registers {apod} tag to smarty_apod() (
smarty.fnc.php:1659)Smarty function registration table maps template tag to PHP handler
3c. smarty_apod() reads DB, formats thumbnail (
smarty.fnc.php:784)Fetches latest stored APOD pic ID from DB — no live NASA domain reference here, unaffected by migration