summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.build_number2
-rw-r--r--installer/install.sql2
-rw-r--r--lib/gallery.dialog.js7
-rw-r--r--modules/g2_import/helpers/g2_import.php4
-rw-r--r--modules/gallery/controllers/admin_theme_options.php2
-rw-r--r--modules/gallery/controllers/file_proxy.php20
-rw-r--r--modules/gallery/helpers/gallery_installer.php12
-rw-r--r--modules/gallery/helpers/graphics.php6
-rw-r--r--modules/gallery/helpers/item.php81
-rw-r--r--modules/gallery/module.info2
-rw-r--r--modules/gallery/tests/File_Proxy_Controller_Test.php2
-rw-r--r--modules/gallery/tests/Item_Helper_Test.php159
-rw-r--r--modules/watermark/controllers/admin_watermarks.php18
13 files changed, 244 insertions, 73 deletions
diff --git a/.build_number b/.build_number
index 83b11537..5a50cd13 100644
--- a/.build_number
+++ b/.build_number
@@ -3,4 +3,4 @@
; process. You don't need to edit it. In fact..
;
; DO NOT EDIT THIS FILE BY HAND!
-build_number=370
+build_number=373
diff --git a/installer/install.sql b/installer/install.sql
index b89d6b9b..f4938f6f 100644
--- a/installer/install.sql
+++ b/installer/install.sql
@@ -245,7 +245,7 @@ CREATE TABLE {modules} (
KEY `weight` (`weight`)
) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO {modules} VALUES (1,1,'gallery',56,1);
+INSERT INTO {modules} VALUES (1,1,'gallery',57,1);
INSERT INTO {modules} VALUES (2,1,'user',4,2);
INSERT INTO {modules} VALUES (3,1,'comment',7,3);
INSERT INTO {modules} VALUES (4,1,'organize',4,4);
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js
index e9f4aa03..8fe85165 100644
--- a/lib/gallery.dialog.js
+++ b/lib/gallery.dialog.js
@@ -137,13 +137,6 @@
},
success: function(data) {
if (data.html) {
- if (data.result == "error") {
- // This is an odd case that arises from the watermarks module. This is because we
- // have a fake xhr, and we rawurlencode the results because the JS code that uploads
- // the file buffers it in an iframe which entitizes the HTML and makes it difficult
- // for the JS to process. See ticket #797.
- data.html = unescape(data.html);
- }
$("#g-dialog").html(data.html);
$("#g-dialog").dialog("option", "position", "center");
$("#g-dialog form :submit").removeClass("ui-state-disabled")
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 70aac747..b155a88a 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -1055,7 +1055,7 @@ class g2_import_Core {
if (@copy(g2($derivative->fetchPath()), $item->thumb_path())) {
$item->thumb_height = $derivative->getHeight();
$item->thumb_width = $derivative->getWidth();
- $item->thumb_dirty = false;
+ $item->thumb_dirty = 0;
}
}
@@ -1066,7 +1066,7 @@ class g2_import_Core {
if (@copy(g2($derivative->fetchPath()), $item->resize_path())) {
$item->resize_height = $derivative->getHeight();
$item->resize_width = $derivative->getWidth();
- $item->resize_dirty = false;
+ $item->resize_dirty = 0;
}
}
}
diff --git a/modules/gallery/controllers/admin_theme_options.php b/modules/gallery/controllers/admin_theme_options.php
index aead8bae..38d2b0a8 100644
--- a/modules/gallery/controllers/admin_theme_options.php
+++ b/modules/gallery/controllers/admin_theme_options.php
@@ -34,7 +34,6 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
module::set_var("gallery", "page_size", $form->edit_theme->page_size->value);
$thumb_size = $form->edit_theme->thumb_size->value;
- $thumb_dirty = false;
if (module::get_var("gallery", "thumb_size") != $thumb_size) {
graphics::remove_rule("gallery", "thumb", "gallery_graphics::resize");
graphics::add_rule(
@@ -45,7 +44,6 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
}
$resize_size = $form->edit_theme->resize_size->value;
- $resize_dirty = false;
if (module::get_var("gallery", "resize_size") != $resize_size) {
graphics::remove_rule("gallery", "resize", "gallery_graphics::resize");
graphics::add_rule(
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 7e5d0038..ac558a71 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -66,24 +66,8 @@ class File_Proxy_Controller extends Controller {
throw $e;
}
- // If the last element is .album.jpg, pop that off since it's not a real item
- $path = preg_replace("|/.album.jpg$|", "", $path);
-
- $item = item::find_by_path($path);
- if (!$item->loaded()) {
- // We didn't turn it up. If we're looking for a .jpg then it's it's possible that we're
- // requesting the thumbnail for a movie. In that case, the movie file would
- // have been converted to a .jpg. So try some alternate types:
- if (preg_match('/.jpg$/', $path)) {
- foreach (legal_file::get_movie_extensions() as $ext) {
- $movie_path = preg_replace('/.jpg$/', ".$ext", $path);
- $item = item::find_by_path($movie_path);
- if ($item->loaded()) {
- break;
- }
- }
- }
- }
+ // Get the item model using the path and type (which corresponds to a var subdir)
+ $item = item::find_by_path($path, $type);
if (!$item->loaded()) {
$e = new Kohana_404_Exception();
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index 051a66cf..d49be83f 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -797,6 +797,18 @@ class gallery_installer {
module::set_var("gallery", "movie_allow_uploads", "autodetect");
module::set_version("gallery", $version = 56);
}
+
+ if ($version == 56) {
+ // Cleanup possible instances where resize_dirty of albums or movies was set to 0. This is
+ // unlikely to have occurred, and doesn't currently matter much since albums and movies don't
+ // have resize images anyway. However, it may be useful to be consistent here going forward.
+ db::build()
+ ->update("items")
+ ->set("resize_dirty", 1)
+ ->where("type", "<>", "photo")
+ ->execute();
+ module::set_version("gallery", $version = 57);
+ }
}
static function uninstall() {
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php
index e66908c4..459784c9 100644
--- a/modules/gallery/helpers/graphics.php
+++ b/modules/gallery/helpers/graphics.php
@@ -121,12 +121,6 @@ class graphics_Core {
if ($item->resize_dirty && $item->is_photo()) {
$ops["resize"] = $item->resize_path();
}
- if (empty($ops)) {
- $item->thumb_dirty = 0;
- $item->resize_dirty = 0;
- $item->save();
- return;
- }
try {
foreach ($ops as $target => $output_file) {
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php
index 9882a9c5..bbbc81d6 100644
--- a/modules/gallery/helpers/item.php
+++ b/modules/gallery/helpers/item.php
@@ -203,10 +203,18 @@ class item_Core {
/**
* Find an item by its path. If there's no match, return an empty Item_Model.
* NOTE: the caller is responsible for performing security checks on the resulting item.
+ *
+ * In addition to $path, $var_subdir can be specified ("albums", "resizes", or "thumbs"). This
+ * corresponds to the file's directory in var, which is what's used in file_proxy. By specifying
+ * this, we can be smarter about items whose formats get converted (e.g. movies that get jpg
+ * thumbs). If omitted, it defaults to "albums" which looks for identical matches between $path
+ * and the item name, just like pre-v3.1 behavior.
+ *
* @param string $path
+ * @param string $var_subdir
* @return object Item_Model
*/
- static function find_by_path($path) {
+ static function find_by_path($path, $var_subdir="albums") {
$path = trim($path, "/");
// The root path name is NULL not "", hence this workaround.
@@ -214,35 +222,80 @@ class item_Core {
return item::root();
}
+ $search_full_name = true;
+ $album_thumb = false;
+ if (($var_subdir == "thumbs") && preg_match("|^(.*)/\.album\.jpg$|", $path, $matches)) {
+ // It's an album thumb - remove "/.album.jpg" from the path.
+ $path = $matches[1];
+ $album_thumb = true;
+ } else if (($var_subdir != "albums") && preg_match("/^(.*)\.jpg$/", $path, $matches)) {
+ // Item itself could be non-jpg (e.g. movies) - remove .jpg from path, don't search full name.
+ $path = $matches[1];
+ $search_full_name = false;
+ }
+
// Check to see if there's an item in the database with a matching relative_path_cache value.
- // Since that field is urlencoded, we must urlencoded the components of the path.
+ // Since that field is urlencoded, we must urlencode the components of the path.
foreach (explode("/", $path) as $part) {
$encoded_array[] = rawurlencode($part);
}
$encoded_path = join("/", $encoded_array);
- $item = ORM::factory("item")
- ->where("relative_path_cache", "=", $encoded_path)
- ->find();
- if ($item->loaded()) {
- return $item;
+ if ($search_full_name) {
+ $item = ORM::factory("item")
+ ->where("relative_path_cache", "=", $encoded_path)
+ ->find();
+ // See if the item was found and if it should have been found.
+ if ($item->loaded() &&
+ (($var_subdir == "albums") || $item->is_photo() || $album_thumb)) {
+ return $item;
+ }
+ } else {
+ // Note that the below query uses LIKE with wildcard % at end, which is still sargable and
+ // therefore still takes advantage of the indexed relative_path_cache (i.e. still quick).
+ $item = ORM::factory("item")
+ ->where("relative_path_cache", "LIKE", Database::escape_for_like($encoded_path) . ".%")
+ ->find();
+ // See if the item was found and should be a jpg.
+ if ($item->loaded() &&
+ (($item->is_movie() && ($var_subdir == "thumbs")) ||
+ ($item->is_photo() && (preg_match("/^(.*)\.jpg$/", $item->name))))) {
+ return $item;
+ }
}
// Since the relative_path_cache field is a cache, it can be unavailable. If we don't find
// anything, fall back to checking the path the hard way.
$paths = explode("/", $path);
- foreach (ORM::factory("item")
- ->where("name", "=", end($paths))
- ->where("level", "=", count($paths) + 1)
- ->find_all() as $item) {
- if (urldecode($item->relative_path()) == $path) {
- return $item;
+ if ($search_full_name) {
+ foreach (ORM::factory("item")
+ ->where("name", "=", end($paths))
+ ->where("level", "=", count($paths) + 1)
+ ->find_all() as $item) {
+ // See if the item was found and if it should have been found.
+ if ((urldecode($item->relative_path()) == $path) &&
+ (($var_subdir == "albums") || $item->is_photo() || $album_thumb)) {
+ return $item;
+ }
+ }
+ } else {
+ foreach (ORM::factory("item")
+ ->where("name", "LIKE", Database::escape_for_like(end($paths)) . ".%")
+ ->where("level", "=", count($paths) + 1)
+ ->find_all() as $item) {
+ // Compare relative_path without extension (regexp same as legal_file::change_extension),
+ // see if it should be a jpg.
+ if ((preg_replace("/\.[^\.\/]*?$/", "", urldecode($item->relative_path())) == $path) &&
+ (($item->is_movie() && ($var_subdir == "thumbs")) ||
+ ($item->is_photo() && (preg_match("/^(.*)\.jpg$/", $item->name))))) {
+ return $item;
+ }
}
}
+ // Nothing found - return an empty item model.
return new Item_Model();
}
-
/**
* Locate an item using the URL. We assume that the url is in the form /a/b/c where each
* component matches up with an item slug. If there's no match, return an empty Item_Model
diff --git a/modules/gallery/module.info b/modules/gallery/module.info
index 2383ec3c..7f49b72e 100644
--- a/modules/gallery/module.info
+++ b/modules/gallery/module.info
@@ -1,6 +1,6 @@
name = "Gallery 3"
description = "Gallery core application"
-version = 56
+version = 57
author_name = "Gallery Team"
author_url = "http://codex.galleryproject.org/Gallery:Team"
info_url = "http://codex.galleryproject.org/Gallery3:Modules:gallery"
diff --git a/modules/gallery/tests/File_Proxy_Controller_Test.php b/modules/gallery/tests/File_Proxy_Controller_Test.php
index 562100e4..06068d62 100644
--- a/modules/gallery/tests/File_Proxy_Controller_Test.php
+++ b/modules/gallery/tests/File_Proxy_Controller_Test.php
@@ -66,7 +66,7 @@ class File_Proxy_Controller_Test extends Gallery_Unit_Test_Case {
public function movie_thumbnails_are_jpgs_test() {
$movie = test::random_movie();
$name = legal_file::change_extension($movie->name, "jpg");
- $_SERVER["REQUEST_URI"] = url::file("var/thumbs/{$movie->name}");
+ $_SERVER["REQUEST_URI"] = url::file("var/thumbs/$name");
$controller = new File_Proxy_Controller();
$this->assert_same($movie->thumb_path(), $controller->__call("", array()));
}
diff --git a/modules/gallery/tests/Item_Helper_Test.php b/modules/gallery/tests/Item_Helper_Test.php
index f5b99bec..f4995c53 100644
--- a/modules/gallery/tests/Item_Helper_Test.php
+++ b/modules/gallery/tests/Item_Helper_Test.php
@@ -164,11 +164,9 @@ class Item_Helper_Test extends Gallery_Unit_Test_Case {
$this->assert_same(item::root()->id, item::find_by_path("")->id);
// Verify that we don't get confused by the part names, using the fallback code.
- db::build()
- ->update("items")
- ->set(array("relative_path_cache" => null))
- ->where("id", "IN", array($level3->id, $level3b->id))
- ->execute();
+ self::_remove_relative_path_caches();
+ self::_remove_relative_path_caches();
+
$this->assert_same(
$level3->id,
item::find_by_path("{$level1->name}/{$level2->name}/{$level3->name}")->id);
@@ -180,11 +178,154 @@ class Item_Helper_Test extends Gallery_Unit_Test_Case {
// Verify that we don't get false positives
$this->assert_false(
item::find_by_path("foo/bar/baz")->loaded());
+ }
- // Verify that the fallback code works
- $this->assert_same(
- $level3b->id,
- item::find_by_path("{$level1->name}/{$level2b->name}/{$level3b->name}")->id);
+ public function find_by_path_with_jpg_test() {
+ $parent = test::random_album();
+ $jpg = test::random_photo($parent);
+
+ $jpg_path = "{$parent->name}/{$jpg->name}";
+ $flv_path = legal_file::change_extension($jpg_path, "flv");
+
+ // Check normal operation.
+ $this->assert_equal($jpg->id, item::find_by_path($jpg_path, "albums")->id);
+ $this->assert_equal($jpg->id, item::find_by_path($jpg_path, "resizes")->id);
+ $this->assert_equal($jpg->id, item::find_by_path($jpg_path, "thumbs")->id);
+ $this->assert_equal($jpg->id, item::find_by_path($jpg_path)->id);
+
+ // Check that we don't get false positives.
+ $this->assert_equal(null, item::find_by_path($flv_path, "albums")->id);
+ $this->assert_equal(null, item::find_by_path($flv_path, "resizes")->id);
+ $this->assert_equal(null, item::find_by_path($flv_path, "thumbs")->id);
+ $this->assert_equal(null, item::find_by_path($flv_path)->id);
+
+ // Check normal operation without relative path cache.
+ self::_remove_relative_path_caches();
+ $this->assert_equal($jpg->id, item::find_by_path($jpg_path, "albums")->id);
+ self::_remove_relative_path_caches();
+ $this->assert_equal($jpg->id, item::find_by_path($jpg_path, "resizes")->id);
+ self::_remove_relative_path_caches();
+ $this->assert_equal($jpg->id, item::find_by_path($jpg_path, "thumbs")->id);
+ self::_remove_relative_path_caches();
+ $this->assert_equal($jpg->id, item::find_by_path($jpg_path)->id);
+
+ // Check that we don't get false positives without relative path cache.
+ self::_remove_relative_path_caches();
+ $this->assert_equal(null, item::find_by_path($flv_path, "albums")->id);
+ $this->assert_equal(null, item::find_by_path($flv_path, "resizes")->id);
+ $this->assert_equal(null, item::find_by_path($flv_path, "thumbs")->id);
+ $this->assert_equal(null, item::find_by_path($flv_path)->id);
+ }
+
+ public function find_by_path_with_png_test() {
+ $parent = test::random_album();
+ $png = test::random_photo_unsaved($parent);
+ $png->set_data_file(MODPATH . "gallery/images/graphicsmagick.png");
+ $png->save();
+
+ $png_path = "{$parent->name}/{$png->name}";
+ $jpg_path = legal_file::change_extension($png_path, "jpg");
+
+ // Check normal operation.
+ $this->assert_equal($png->id, item::find_by_path($png_path, "albums")->id);
+ $this->assert_equal($png->id, item::find_by_path($png_path, "resizes")->id);
+ $this->assert_equal($png->id, item::find_by_path($png_path, "thumbs")->id);
+ $this->assert_equal($png->id, item::find_by_path($png_path)->id);
+
+ // Check that we don't get false positives.
+ $this->assert_equal(null, item::find_by_path($jpg_path, "albums")->id);
+ $this->assert_equal(null, item::find_by_path($jpg_path, "resizes")->id);
+ $this->assert_equal(null, item::find_by_path($jpg_path, "thumbs")->id);
+ $this->assert_equal(null, item::find_by_path($jpg_path)->id);
+
+ // Check normal operation without relative path cache.
+ self::_remove_relative_path_caches();
+ $this->assert_equal($png->id, item::find_by_path($png_path, "albums")->id);
+ self::_remove_relative_path_caches();
+ $this->assert_equal($png->id, item::find_by_path($png_path, "resizes")->id);
+ self::_remove_relative_path_caches();
+ $this->assert_equal($png->id, item::find_by_path($png_path, "thumbs")->id);
+ self::_remove_relative_path_caches();
+ $this->assert_equal($png->id, item::find_by_path($png_path)->id);
+
+ // Check that we don't get false positives without relative path cache.
+ self::_remove_relative_path_caches();
+ $this->assert_equal(null, item::find_by_path($jpg_path, "albums")->id);
+ $this->assert_equal(null, item::find_by_path($jpg_path, "resizes")->id);
+ $this->assert_equal(null, item::find_by_path($jpg_path, "thumbs")->id);
+ $this->assert_equal(null, item::find_by_path($jpg_path)->id);
+ }
+
+ public function find_by_path_with_flv_test() {
+ $parent = test::random_album();
+ $flv = test::random_movie($parent);
+
+ $flv_path = "{$parent->name}/{$flv->name}";
+ $jpg_path = legal_file::change_extension($flv_path, "jpg");
+
+ // Check normal operation.
+ $this->assert_equal($flv->id, item::find_by_path($flv_path, "albums")->id);
+ $this->assert_equal($flv->id, item::find_by_path($jpg_path, "thumbs")->id);
+ $this->assert_equal($flv->id, item::find_by_path($flv_path)->id);
+
+ // Check that we don't get false positives.
+ $this->assert_equal(null, item::find_by_path($jpg_path, "albums")->id);
+ $this->assert_equal(null, item::find_by_path($flv_path, "thumbs")->id);
+ $this->assert_equal(null, item::find_by_path($jpg_path)->id);
+
+ // Check normal operation without relative path cache.
+ self::_remove_relative_path_caches();
+ $this->assert_equal($flv->id, item::find_by_path($flv_path, "albums")->id);
+ self::_remove_relative_path_caches();
+ $this->assert_equal($flv->id, item::find_by_path($jpg_path, "thumbs")->id);
+ self::_remove_relative_path_caches();
+ $this->assert_equal($flv->id, item::find_by_path($flv_path)->id);
+
+ // Check that we don't get false positives without relative path cache.
+ self::_remove_relative_path_caches();
+ $this->assert_equal(null, item::find_by_path($jpg_path, "albums")->id);
+ $this->assert_equal(null, item::find_by_path($flv_path, "thumbs")->id);
+ $this->assert_equal(null, item::find_by_path($jpg_path)->id);
+ }
+
+ public function find_by_path_with_album_test() {
+ $parent = test::random_album();
+ $album = test::random_movie($parent);
+
+ $album_path = "{$parent->name}/{$album->name}";
+ $thumb_path = "{$album_path}/.album.jpg";
+
+ // Check normal operation.
+ $this->assert_equal($album->id, item::find_by_path($album_path, "albums")->id);
+ $this->assert_equal($album->id, item::find_by_path($thumb_path, "thumbs")->id);
+ $this->assert_equal($album->id, item::find_by_path($album_path)->id);
+
+ // Check that we don't get false positives.
+ $this->assert_equal(null, item::find_by_path($thumb_path, "albums")->id);
+ $this->assert_equal(null, item::find_by_path($album_path, "thumbs")->id);
+ $this->assert_equal(null, item::find_by_path($thumb_path)->id);
+
+ // Check normal operation without relative path cache.
+ self::_remove_relative_path_caches();
+ $this->assert_equal($album->id, item::find_by_path($album_path, "albums")->id);
+ self::_remove_relative_path_caches();
+ $this->assert_equal($album->id, item::find_by_path($thumb_path, "thumbs")->id);
+ self::_remove_relative_path_caches();
+ $this->assert_equal($album->id, item::find_by_path($album_path)->id);
+
+ // Check that we don't get false positives without relative path cache.
+ self::_remove_relative_path_caches();
+ $this->assert_equal(null, item::find_by_path($thumb_path, "albums")->id);
+ $this->assert_equal(null, item::find_by_path($album_path, "thumbs")->id);
+ $this->assert_equal(null, item::find_by_path($thumb_path)->id);
+ }
+
+ private function _remove_relative_path_caches() {
+ // This gets used *many* times in the find_by_path tests above to check the fallback code.
+ db::build()
+ ->update("items")
+ ->set("relative_path_cache", null)
+ ->execute();
}
public function find_by_relative_url_test() {
diff --git a/modules/watermark/controllers/admin_watermarks.php b/modules/watermark/controllers/admin_watermarks.php
index 222279e8..bbefcf01 100644
--- a/modules/watermark/controllers/admin_watermarks.php
+++ b/modules/watermark/controllers/admin_watermarks.php
@@ -55,6 +55,8 @@ class Admin_Watermarks_Controller extends Admin_Controller {
} else {
json::reply(array("result" => "error", "html" => (string)$form));
}
+ // Override the application/json mime type for iframe compatibility. See ticket #2022.
+ header("Content-Type: text/plain; charset=" . Kohana::CHARSET);
}
public function form_delete() {
@@ -83,6 +85,8 @@ class Admin_Watermarks_Controller extends Admin_Controller {
} else {
json::reply(array("result" => "error", "html" => (string)$form));
}
+ // Override the application/json mime type for iframe compatibility. See ticket #2022.
+ header("Content-Type: text/plain; charset=" . Kohana::CHARSET);
}
public function form_add() {
@@ -126,18 +130,10 @@ class Admin_Watermarks_Controller extends Admin_Controller {
log::success("watermark", t("Watermark saved"));
json::reply(array("result" => "success", "location" => url::site("admin/watermarks")));
} else {
- // rawurlencode the results because the JS code that uploads the file buffers it in an
- // iframe which entitizes the HTML and makes it difficult for the JS to process. If we url
- // encode it now, it passes through cleanly. See ticket #797.
- json::reply(array("result" => "error", "html" => rawurlencode((string)$form)));
+ json::reply(array("result" => "error", "html" => (string)$form));
}
-
- // Override the application/json mime type. The dialog based HTML uploader uses an iframe to
- // buffer the reply, and on some browsers (Firefox 3.6) it does not know what to do with the
- // JSON that it gets back so it puts up a dialog asking the user what to do with it. So force
- // the encoding type back to HTML for the iframe.
- // See: http://jquery.malsup.com/form/#file-upload
- header("Content-Type: text/html; charset=" . Kohana::CHARSET);
+ // Override the application/json mime type for iframe compatibility. See ticket #2022.
+ header("Content-Type: text/plain; charset=" . Kohana::CHARSET);
}
private function _update_graphics_rules() {