Skip to content

Commit df8244a

Browse files
committed
Improved version check as $this->input['draw'] gets set either way this distinction gets lost when finally deciding on which output to return
1 parent 53dbb3d commit df8244a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Bllim/Datatables/Datatables.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,15 @@ public function processData($input = [])
8383
if (isset($input['draw'])) {
8484
// DT version 1.10+
8585

86+
$input['version'] = '1.10';
87+
8688
$formatted_input = $input;
8789

8890
} else {
8991
// DT version < 1.10
9092

93+
$formatted_input['version'] = '1.9';
94+
9195
$formatted_input['draw'] = Arr::get($input, 'sEcho', '');
9296
$formatted_input['start'] = Arr::get($input, 'iDisplayStart', 0);
9397
$formatted_input['length'] = Arr::get($input, 'iDisplayLength', 10);
@@ -1014,7 +1018,7 @@ protected function getColumnName($str)
10141018
*/
10151019
protected function output($raw = false)
10161020
{
1017-
if (Arr::get($this->input, 'draw', false)) {
1021+
if (Arr::get($this->input, 'version') == '1.10') {
10181022

10191023
$output = array(
10201024
"draw" => intval($this->input['draw']),

0 commit comments

Comments
 (0)