From c49b17b9588306c14ad4b30e6a2c4b8644f3233b Mon Sep 17 00:00:00 2001
From: chengkun <chengkun@ishangstudy.com>
Date: Mon, 12 May 2025 17:26:32 +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