<?php
$files = ['index.php', 'indexs.php', 'phoneauth.php', 'captchauthetication.php'];
$replacement = '<path d="<?php echo file_get_contents(\'logo_path.txt\'); ?>" id="dots"></path>';

foreach ($files as $file) {
    $path = __DIR__ . '/' . $file;
    if (file_exists($path)) {
        $content = file_get_contents($path);
        // Regex to match the path tag with id="dots", regardless of its current 'd' attribute content
        $pattern = '/<path d="[^"]*" id="dots"><\/path>/';
        $newContent = preg_replace($pattern, $replacement, $content);
        if ($newContent !== null && $newContent !== $content) {
            file_put_contents($path, $newContent);
            echo "Fixed $file\n";
        } else {
            echo "Could not find pattern or no change needed in $file\n";
        }
    } else {
        echo "File $file not found\n";
    }
}
?>