Skip to content

Commit 2bfce30

Browse files
committed
Fix proper cleaning of snippets for usage
1 parent 8ac225d commit 2bfce30

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Snippets/Snippets.API.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function xmlhttprequest_plugin_snippets() {
88

99
# load snippets available to the user
1010
$user_id = auth_get_current_user_id();
11-
$snippets = Snippet::load_by_type_user(0, $user_id);
11+
$snippets = Snippet::clean(Snippet::load_by_type_user(0, $user_id), "form");
1212

1313
$data_array = array(
1414
"lang" => array(
@@ -19,12 +19,10 @@ function xmlhttprequest_plugin_snippets() {
1919

2020
# arrange the available snippets into the data array
2121
foreach($snippets as $snippet) {
22-
$snippet = Snippet::clean($snippet);
2322
$data_array["bugnote_text"][$snippet->id] = $snippet;
2423
}
2524

2625
$json = json_encode($data_array);
27-
file_put_contents("/tmp/snippets", print_r($json, true));
2826
echo $json;
2927

3028
plugin_pop_current();

0 commit comments

Comments
 (0)