From 8642932b71c25e340c9b76d4432de77f9caeed36 Mon Sep 17 00:00:00 2001
From: chengkun <chengkun@ishangstudy.com>
Date: Tue, 20 May 2025 17:11:58 +0800
Subject: [PATCH] 提交
---
js/ueditor/php/action_crawler.php | 27 +++++++++++----------------
1 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/js/ueditor/php/action_crawler.php b/js/ueditor/php/action_crawler.php
index b6dad41..0824cf8 100644
--- a/js/ueditor/php/action_crawler.php
+++ b/js/ueditor/php/action_crawler.php
@@ -35,27 +35,22 @@
/* 抓取远程图片 */
$list = array();
-if (isset($_POST[$fieldName])) {
- $source = $_POST[$fieldName];
-} else {
- $source = $_GET[$fieldName];
-}
+$source = $_POST[$fieldName] ? $_GET[$fieldName]:"";
foreach ($source as $imgUrl) {
$item = new Uploader($imgUrl, $config, "remote");
$info = $item->getFileInfo();
- array_push($list, array(
- "state" => $info["state"],
- "url" => $info["url"],
- "size" => $info["size"],
- "title" => htmlspecialchars($info["title"]),
+ $list[] = array(
+ "state" => $info["state"],
+ "url" => $info["url"],
+ "size" => $info["size"],
+ "title" => htmlspecialchars($info["title"]),
"original" => htmlspecialchars($info["original"]),
- "source" => htmlspecialchars($imgUrl)
- ));
+ "source" => htmlspecialchars($imgUrl)
+ );
}
/* 返回抓取数据 */
return json_encode(array(
- 'state'=> count($list) ? 'SUCCESS':'ERROR',
- 'list'=> $list
-));
-*/
\ No newline at end of file
+ 'state' => count($list) ? 'SUCCESS' : 'ERROR',
+ 'list' => $list
+));
\ No newline at end of file
--
Gitblit v1.9.0