1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-05 04:37:51 +02:00

Pages Plugin: page expand ajax bug #115 - fixed

This commit is contained in:
Awilum
2013-06-29 13:12:30 +03:00
parent 48a62e5011
commit 86312eb270
2 changed files with 3 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ $.monstra.pages = {
pageExpand: function(slug, expand, token) { pageExpand: function(slug, expand, token) {
$.ajax({ $.ajax({
type:"post", type:"post",
data:"slug="+slug+"&expand="+expand+"&token="+token, data:"page_slug="+slug+"&page_expand="+expand+"&token="+token,
url: $('form input[name="url"]').val() url: $('form input[name="url"]').val()
}); });
}, },

View File

@@ -23,10 +23,10 @@ class PagesAdmin extends Backend
*/ */
public static function _pageExpandAjax() public static function _pageExpandAjax()
{ {
if (Request::post('slug')) { if (Request::post('page_slug')) {
if (Security::check(Request::post('token'))) { if (Security::check(Request::post('token'))) {
$pages = new Table('pages'); $pages = new Table('pages');
$pages->updateWhere('[slug="'.Request::post('slug').'"]', array('expand' => Request::post('expand'))); $pages->updateWhere('[slug="'.Request::post('page_slug').'"]', array('expand' => Request::post('page_expand')));
Request::shutdown(); Request::shutdown();
} else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); }
} }