use detaintPath on modal to prevent including other files instead of real modals
parent
4067151fd8
commit
119e4e6756
|
@ -1,11 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
if (empty($_REQUEST['modal'])) {
|
||||||
if ( empty($_REQUEST['modal']) ) {
|
|
||||||
ajaxError('Modal Name Not Provided');
|
ajaxError('Modal Name Not Provided');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$modal = validJsStr($_REQUEST['modal']);
|
$modal = detaintPath($_REQUEST['modal']);
|
||||||
$data = array();
|
$data = array();
|
||||||
|
|
||||||
ZM\Debug("Including modals/$modal.php");
|
ZM\Debug("Including modals/$modal.php");
|
||||||
|
@ -14,7 +13,7 @@ ob_start();
|
||||||
@$result = include('modals/'.$modal.'.php');
|
@$result = include('modals/'.$modal.'.php');
|
||||||
$data['html'] = ob_get_contents();
|
$data['html'] = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
if ( !$result ) {
|
if (!$result) {
|
||||||
ajaxError("Unknown modal '".$modal."'");
|
ajaxError("Unknown modal '".$modal."'");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue