summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend.php5
-rw-r--r--js/dict.js2
2 files changed, 5 insertions, 2 deletions
diff --git a/backend.php b/backend.php
index 4ed612b..a5dc56e 100644
--- a/backend.php
+++ b/backend.php
@@ -244,7 +244,10 @@
if (defined('DICT_ENABLED') && DICT_ENABLED) {
- $word = escapeshellarg($_REQUEST["word"]);
+ /* strip hyphens */
+ $word = str_replace("­", "", $_REQUEST["word"]);
+
+ $word = escapeshellarg($word);
exec(DICT_CLIENT . " -h ". DICT_SERVER ." $word 2>&1", $output, $rc);
diff --git a/js/dict.js b/js/dict.js
index 1c802e7..d85b75c 100644
--- a/js/dict.js
+++ b/js/dict.js
@@ -10,7 +10,7 @@ $(document).ready(function() {
const sel = getSelection().toString().trim();
- if (sel.match(/^\w+$/)) {
+ if (sel.match(/^[\w­]+$/)) {
Reader.lookupWord(sel, function() {
if (typeof EpubeApp != "undefined")
EpubeApp.showActionBar(false);