From bd0551b22076b82a6d49e9f7a2b2e0c90a1b2326 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 05 Feb 2016 07:25:27 -0500
Subject: [PATCH] Secure also downloads of addressbook exports, managesieve script exports and Enigma keys exports

---
 program/lib/Roundcube/rcube_spellcheck_pspell.php |   33 ++++++++++++++++++++++++++++++---
 1 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/program/lib/Roundcube/rcube_spellcheck_pspell.php b/program/lib/Roundcube/rcube_spellcheck_pspell.php
index ce089ed..8f3a1ad 100644
--- a/program/lib/Roundcube/rcube_spellcheck_pspell.php
+++ b/program/lib/Roundcube/rcube_spellcheck_pspell.php
@@ -1,6 +1,6 @@
 <?php
 
-/*
+/**
  +-----------------------------------------------------------------------+
  | This file is part of the Roundcube Webmail client                     |
  |                                                                       |
@@ -28,6 +28,35 @@
 {
     private $plink;
     private $matches = array();
+
+    /**
+     * Return a list of languages supported by this backend
+     *
+     * @see rcube_spellcheck_engine::languages()
+     */
+    function languages()
+    {
+        $defaults = array('en');
+        $langs = array();
+
+        // get aspell dictionaries
+        exec('aspell dump dicts', $dicts);
+        if (!empty($dicts)) {
+            $seen = array();
+            foreach ($dicts as $lang) {
+                $lang = preg_replace('/-.*$/', '', $lang);
+                $langc = strlen($lang) == 2 ? $lang.'_'.strtoupper($lang) : $lang;
+                if (!$seen[$langc]++)
+                    $langs[] = $lang;
+            }
+            $langs = array_unique($langs);
+        }
+        else {
+            $langs = $defaults;
+        }
+
+        return $langs;
+    }
 
     /**
      * Initializes PSpell dictionary
@@ -155,6 +184,4 @@
 
         return $result;
     }
-
 }
-

--
Gitblit v1.9.1