Debug: Add minimal logging to verify filter execution

This commit is contained in:
FrankZamora
2025-11-27 13:40:09 -06:00
parent 52e2698279
commit 98c90756f8
2 changed files with 306 additions and 0 deletions

View File

@@ -32,10 +32,15 @@ final class YoutubeFacadeContentFilter
*/
public function filter(string $content): string
{
// Temporary debug
file_put_contents('/tmp/yt-debug.log', date('H:i:s') . " filter called\n", FILE_APPEND);
// Check if content has YouTube embeds at all (quick check)
if (strpos($content, 'youtube.com/embed/') === false && strpos($content, 'youtube-nocookie.com/embed/') === false) {
file_put_contents('/tmp/yt-debug.log', date('H:i:s') . " no youtube found\n", FILE_APPEND);
return $content;
}
file_put_contents('/tmp/yt-debug.log', date('H:i:s') . " youtube FOUND\n", FILE_APPEND);
// Pattern to match YouTube iframes
// Handles: youtube.com/embed/ and youtube-nocookie.com/embed/