Create an ajax response framework that inserts <meta> tags to guard

against UTF-7, and create a $.gallery_autocomplete variant of jQuery's
autocomplete that expects the first line to be a <meta> tag and
discards it.  More complete fix for #1871.
This commit is contained in:
Bharat Mediratta
2012-05-19 11:28:46 -07:00
parent 74fa9422db
commit a9be0691d9
9 changed files with 69 additions and 9 deletions

View File

@@ -72,6 +72,7 @@ class Admin_Server_Add_Controller extends Admin_Controller {
public function autocomplete() {
$directories = array();
$path_prefix = Input::instance()->get("q");
foreach (glob("{$path_prefix}*") as $file) {
if (is_dir($file) && !is_link($file)) {
@@ -79,7 +80,7 @@ class Admin_Server_Add_Controller extends Admin_Controller {
}
}
print implode("\n", $directories);
ajax::response(implode("\n", $directories));
}
private function _get_admin_form() {