]*)src="(.*)"([^>]*)\/>/Us', function ($matches) use ($path) { $url = htmlspecialchars_decode($matches[2], ENT_QUOTES); $url = normalizeUrl($url, $path, 'imgSrc'); $url = checkLocalFile($url, 'imgSrc'); if (false === $url) { exit($path.PHP_EOL); } return ''; }, $text); $text = preg_replace_callback('/]*)href="([^"]+)"([^>]*)>/Us', function ($matches) use ($path) { $url = htmlspecialchars_decode($matches[2], ENT_QUOTES); if (!preg_match('/^#/', $url)) { $url = normalizeUrl($url, $path, 'aHref'); if (false === $url) { exit($path.PHP_EOL); } $url = checkLocalFile($url, 'aHref'); if (false === $url) { exit($path.PHP_EOL); } } return ''; }, $text); $text = preg_replace_callback('/]*)src="(.*)"([^>]*)\/>/Us', function ($matches) use ($path) { $url = htmlspecialchars_decode($matches[2], ENT_QUOTES); $url = normalizeUrl($url, $path, 'embedSrc'); if (false === $url) { exit($path.PHP_EOL); } $url = checkLocalFile($url, 'embedSrc'); if (false === $url) { exit($path.PHP_EOL); } return ''; }, $text); $text = preg_replace_callback('/