diff options
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/gallery_task.php | 2 | ||||
-rw-r--r-- | modules/gallery/helpers/graphics.php | 2 | ||||
-rw-r--r-- | modules/gallery/helpers/l10n_client.php | 4 | ||||
-rw-r--r-- | modules/gallery/helpers/p.php | 13 |
4 files changed, 17 insertions, 4 deletions
diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php index 2493c49e..1152cda2 100644 --- a/modules/gallery/helpers/gallery_task.php +++ b/modules/gallery/helpers/gallery_task.php @@ -109,7 +109,7 @@ class gallery_task_Core { case "find_files": // 0% - 10% while (($dir = array_pop($dirs)) && microtime(true) - $start < 0.5) { - if (basename($dir) == "tests") { + if (in_array(basename($dir), array("tests", "lib"))) { continue; } diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 71b8ddd8..bbae0602 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -195,7 +195,7 @@ class graphics_Core { self::init_toolkit(); } - if (filesize($input_file) == 0) { + if (@filesize($input_file) == 0) { throw new Exception("@todo EMPTY_INPUT_FILE"); } diff --git a/modules/gallery/helpers/l10n_client.php b/modules/gallery/helpers/l10n_client.php index 20f81ecc..e153532c 100644 --- a/modules/gallery/helpers/l10n_client.php +++ b/modules/gallery/helpers/l10n_client.php @@ -112,7 +112,9 @@ class l10n_client_Core { // {key:<key_2>, ...} // ] $count = count($response); - log::info("translations", "Installed $count new / updated translation messages"); + log::info("translations", + t2("Installed 1 new / updated translation message", + "Installed %count new / updated translation messages", $count)); foreach ($response as $message_data) { // @todo Better input validation diff --git a/modules/gallery/helpers/p.php b/modules/gallery/helpers/p.php index 0a6210dc..fe53102c 100644 --- a/modules/gallery/helpers/p.php +++ b/modules/gallery/helpers/p.php @@ -18,7 +18,18 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class p_Core { + private static $_purifier = null; static function clean($dirty_html) { - return html::specialchars($dirty_html); + if (empty(self::$_purifier)) { + require_once(dirname(__file__) . "/../lib/HTMLPurifier/HTMLPurifier.auto.php"); + $config = HTMLPurifier_Config::createDefault(); + foreach (Kohana::config('purifier') as $category => $key_value) { + foreach ($key_value as $key => $value) { + $config->set("$category.$key", $value); + } + } + self::$_purifier = new HTMLPurifier($config); + } + return self::$_purifier->purify($dirty_html); } } |