about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-06-21 12:42:37 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-06-21 12:42:37 +0300
commit1215afa6ef28a6e0a53aab98263e922b7c66a580 (patch)
treed19433bc751e2e70fc98b2c6965ed7ba8a591e36
parentb37e5986cf392132b5fd773d9f3e0f25f7f1886b (diff)
downloadthe-epube-1215afa6ef28a6e0a53aab98263e922b7c66a580.tar.gz
the-epube-1215afa6ef28a6e0a53aab98263e922b7c66a580.tar.xz
stop passing actual curl error to frontend if define word handler fails
-rw-r--r--classes/Handler/DefineHandler.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/classes/Handler/DefineHandler.php b/classes/Handler/DefineHandler.php
index f15885f..3da21da 100644
--- a/classes/Handler/DefineHandler.php
+++ b/classes/Handler/DefineHandler.php
@@ -53,7 +53,11 @@ class DefineHandler implements RequestHandlerInterface, AuthRequired
                     $word = mb_substr($word, 0, mb_strlen($word) - 1);
                 }
             } else {
-                array_push($result, curl_error($ch));
+                $curlErr = curl_error($ch);
+                if ($curlErr) {
+                    user_error("dictd define lookup failed for '$word': $curlErr", E_USER_WARNING);
+                }
+                array_push($result, "Dictionary lookup failed. Please try again later.");
             }
 
             curl_close($ch);