fl4p / WP-Filebase

WP-Filebase
http://wpfilebase.com/
34 stars 35 forks source link

Unexpected token < in JSON at position 0 #48

Open bruno-barros opened 8 years ago

bruno-barros commented 8 years ago

The tree file browser (front and admin) is returning a JSON with <?php tag. The Javascript error is Unexpected token < in JSON at position 0; Another plugins works just fine but Filebase.

filebase

The response:

<?php[{"id":"wpfb-cat-0","cat_id":0,"text":"<form action=\"\" style=\"display:none;\"><input type=\"text\" placeholder=\"Nome da Categoria\" name=\"cat_name\" \/><\/form> <a href=\"#\" style=\"text-decoration:none;\" onclick='return wpfb_newCatInput(this,1);'><span style=\"font-size:32px;width:32px;line-height:0;vertical-align:sub;display:inline-block;text-align:center;\">+<\/span>Adicionar categoria<\/a><span style=\"font-size: 200%;vertical-align: sub;line-height: 0;font-weight: lighter;\"> \/ <\/span><a href=\"#\" style=\"text-decoration:none;\" class=\"add-file\"><span style=\"font-size:32px;width:32px;line-height:0;vertical-align:sub;display:inline-block;text-align:center;\">+<\/span>Adicionar Arquivo<\/a>","hasChildren":false,"classes":"add-item"}]
bruno-barros commented 8 years ago

Editing a page. When using the shortcode generator the request to file browser is made to .../wp-admin/admin-ajax.php?action=wpfilebase. So this works! But sendind the request to .../?filebase_ajax=1 don't.