{"record":{"id":"815e8384d8391ab7","repo":"wallabag/wallabag","slug":"wallabag-article-reporting-url-must-be-an-absolute","errorCode":null,"errorMessage":"WALLABAG_ARTICLE_REPORTING_URL must be an absolute HTTPS URL or a mailto URI with one valid recipient.","messagePattern":"WALLABAG_ARTICLE_REPORTING_URL must be an absolute HTTPS URL or a mailto URI with one valid recipient\\.","errorType":"validation","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"critical","filePath":"src/DependencyInjection/Compiler/ArticleReportingUrlPass.php","lineNumber":40,"sourceCode":"        if ('' === $reportingUrl) {\n            $reportingUrl = self::DEFAULT_REPORTING_URL;\n        }\n\n        $scheme = strtolower((string) parse_url($reportingUrl, \\PHP_URL_SCHEME));\n        $isValid = false;\n\n        if ('https' === $scheme) {\n            $isValid = false !== filter_var($reportingUrl, \\FILTER_VALIDATE_URL)\n                && '' !== (string) parse_url($reportingUrl, \\PHP_URL_HOST);\n        } elseif ('mailto' === $scheme) {\n            $recipient = parse_url($reportingUrl, \\PHP_URL_PATH);\n            $isValid = false !== filter_var($reportingUrl, \\FILTER_VALIDATE_URL)\n                && \\is_string($recipient)\n                && false !== filter_var(rawurldecode($recipient), \\FILTER_VALIDATE_EMAIL);\n        }\n\n        if (!$isValid) {\n            throw new \\InvalidArgumentException(self::INVALID_REPORTING_URL_MESSAGE);\n        }\n\n        $container->setParameter(\n            'wallabag.article_reporting_url',\n            $container->getParameterBag()->escapeValue($reportingUrl)\n        );\n    }\n}\n","sourceCodeStart":22,"sourceCodeEnd":49,"githubUrl":"https://github.com/wallabag/wallabag/blob/efe93850ad9006711d871879ae37cc06af3d3bf3/src/DependencyInjection/Compiler/ArticleReportingUrlPass.php#L22-L49","documentation":"At container-compile time (cache warmup / cache:clear, not at runtime) wallabag validates the WALLABAG_ARTICLE_REPORTING_URL env var through the ArticleReportingUrlPass compiler pass. The value must be either an absolute https:// URL that passes FILTER_VALIDATE_URL and has a host, or a mailto: URI whose path is a syntactically valid email. Anything else — http://, relative paths, mailto: with empty/invalid recipient — throws InvalidArgumentException and the container fails to build.","triggerScenarios":"Setting WALLABAG_ARTICLE_REPORTING_URL=http://collector.example.com/report; a bare 'collector.example.com'; 'mailto:' without an address; 'mailto:user@invalid..com'; then running composer install or bin/console cache:clear.","commonSituations":"Ops teams pointing article-abuse reporting at an internal HTTP endpoint (TLS not yet set up); copy/pasting an email with query params into the mailto form; deploying with the var defined globally in the shell so it leaks into cache rebuilds.","solutions":["Use an HTTPS absolute URL: WALLABAG_ARTICLE_REPORTING_URL=\"https://collector.example.com/report\"","Or a mailto with exactly one valid recipient: WALLABAG_ARTICLE_REPORTING_URL=\"mailto:abuse@example.com\"","If you do not need reporting, unset/remove the variable entirely instead of leaving a placeholder","Re-run bin/console cache:clear (or redeploy) to confirm the container compiles"],"exampleFix":"# before\nWALLABAG_ARTICLE_REPORTING_URL=\"http://collector.example.com/report\"\n# after\nWALLABAG_ARTICLE_REPORTING_URL=\"https://collector.example.com/report\"\n# or\nWALLABAG_ARTICLE_REPORTING_URL=\"mailto:abuse@example.com\"","handlingStrategy":"validation","validationCode":"function isValidReportingUrl(string $url): bool\n{\n    $scheme = parse_url($url, PHP_URL_SCHEME);\n    if ('https' === $scheme) {\n        return false !== filter_var($url, FILTER_VALIDATE_URL)\n            && '' !== (string) parse_url($url, PHP_URL_HOST);\n    }\n    if ('mailto' === $scheme) {\n        $recipient = parse_url($url, PHP_URL_PATH);\n\n        return false !== filter_var($url, FILTER_VALIDATE_URL)\n            && is_string($recipient)\n            && false !== filter_var(rawurldecode($recipient), FILTER_VALIDATE_EMAIL);\n    }\n\n    return false;\n}\n\nif (isset($_ENV['WALLABAG_ARTICLE_REPORTING_URL']) && !isValidReportingUrl($_ENV['WALLABAG_ARTICLE_REPORTING_URL'])) {\n    throw new InvalidArgumentException('WALLABAG_ARTICLE_REPORTING_URL must be https://… or mailto:user@example.com');\n}","typeGuard":null,"tryCatchPattern":"try {\n    $process->run('bin/console cache:clear');\n} catch (ProcessFailedException $e) {\n    if (str_contains($e->getMessage(), 'WALLABAG_ARTICLE_REPORTING_URL')) {\n        // unset the var or set a valid https:// / mailto: value, then clear cache again\n    }\n}","preventionTips":["Use absolute https:// URLs or mailto:one-valid-recipient for WALLABAG_ARTICLE_REPORTING_URL","Never leave placeholder values in env files — unset the var instead","Validate the env var in CI before deploying so cache warmup cannot fail in production","Remember this fails at container build (cache:clear), not at request time"],"tags":["env-var","container-build","configuration","validation","wallabag"],"backgroundTag":"invalid-env-var","analyzedSha":"efe93850ad9006711d871879ae37cc06af3d3bf3","analyzedAt":"2026-08-21T01:21:43.612Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}