|
@@ -26,7 +26,7 @@ function downloadImage($url, $filepath)
|
|
|
function replaceImageLinksInFile($filePath, $imagesDir)
|
|
function replaceImageLinksInFile($filePath, $imagesDir)
|
|
|
{
|
|
{
|
|
|
$data = file_get_contents($filePath);
|
|
$data = file_get_contents($filePath);
|
|
|
- $regex = '/!\[.*?\]\((https:\/\/res07\.ftqq\.com\/.*?\.png)\)/';
|
|
|
|
|
|
|
+ $regex = '/!\[.*?\]\((https:\/\/res07\.ftqq\.com\/.*?\.(jpg|png|gif|bmp|webp))\)/';
|
|
|
|
|
|
|
|
preg_match_all($regex, $data, $matches, PREG_SET_ORDER);
|
|
preg_match_all($regex, $data, $matches, PREG_SET_ORDER);
|
|
|
foreach ($matches as $match) {
|
|
foreach ($matches as $match) {
|