Skip to content

Commit c9c1c8c

Browse files
committed
Merge branch 'master' into filters-with-untouched-name
2 parents b7866e0 + 8109ca0 commit c9c1c8c

File tree

280 files changed

+39370
-40900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+39370
-40900
lines changed

SECURITY.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Updates are provided according to table below.
6+
7+
| Version | Security Updates | Feature Updates | Bug Fixes |
8+
| ------- | ------------------ | ------------------ | ------------------ |
9+
| 4.1.x | :white_check_mark: | :white_check_mark: | :white_check_mark: |
10+
| 4.0.x | :white_check_mark: | :x: | :x: |
11+
| 3.6.x | :white_check_mark: | :x: | :x: |
12+
| 3.5.x | :x: | :x: | :x: |
13+
| 3.4.x | :x: | :x: | :x: |
14+
| < 4.0 | :x: | :x: | :x: |
15+
16+
## Reporting a Vulnerability
17+
18+
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
19+
20+
## Past Vulnerabilities
21+
22+
Since its inception in 2016, Backpack has had zero security breaches or reported security issues. However, its dependencies _have_ had security flaws discovered and fixed - even major ones like Laravel, Bootstrap and jQuery. That's why it's a good idea for any project to be reasonably up-to-date. If we consider a security issue is something that affects our users, we'll email you.
23+
24+
It's _heavily_ recommended that you **[subscribe to the Backpack Newsletter](http://backpackforlaravel.com/newsletter)** so you can find out about any security updates, breaking changes or major features. We send an email about 1-2 emails per year. Sometimes less.

package-lock.json

Lines changed: 543 additions & 246 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,34 @@
1010
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
1111
},
1212
"devDependencies": {
13-
"cross-env": "^7.0.0",
13+
"cross-env": "^7.0.2",
1414
"css-loader": "^3.6.0",
15-
"laravel-mix": "^5.0.0",
16-
"lodash": "^4.17.13",
15+
"laravel-mix": "^5.0.4",
16+
"lodash": "^4.17.20",
1717
"pace": "0.0.4",
1818
"resolve-url-loader": "^3.1.1",
19-
"sass": "^1.26.9",
20-
"sass-loader": "^8.0.2",
19+
"sass": "^1.26.10",
20+
"sass-loader": "^9.0.3",
2121
"vue-template-compiler": "^2.6.11"
2222
},
2323
"dependencies": {
2424
"@coreui/coreui": "^2.1.16",
2525
"@digitallyhappy/backstrap": "^0.3.2",
2626
"animate.css": "^3.7.2",
27-
"bootstrap": "^4.4.1",
27+
"bootstrap": "^4.5.2",
2828
"bootstrap-colorpicker": "^3.2.0",
2929
"bootstrap-datepicker": "^1.9.0",
3030
"bootstrap-daterangepicker": "^3.1.0",
3131
"bootstrap-iconpicker": "^1.8.2",
3232
"ckeditor": "^4.12.1",
3333
"cropperjs": "^1.5.7",
34-
"datatables.net": "^1.10.20",
35-
"datatables.net-bs4": "^1.10.20",
36-
"datatables.net-fixedheader": "^3.1.6",
37-
"datatables.net-fixedheader-bs4": "^3.1.6",
34+
"datatables.net": "^1.10.21",
35+
"datatables.net-bs4": "^1.10.21",
36+
"datatables.net-fixedheader": "^3.1.7",
37+
"datatables.net-fixedheader-bs4": "^3.1.7",
3838
"datatables.net-responsive": "^2.2.5",
3939
"datatables.net-responsive-bs4": "^2.2.5",
40-
"easymde": "^2.10.1",
40+
"easymde": "^2.11.0",
4141
"jquery": "^3.5.1",
4242
"jquery-colorbox": "^1.6.4",
4343
"jquery-cropper": "^1.0.1",
@@ -48,17 +48,17 @@
4848
"nonblockjs": "^1.0.8",
4949
"noty": "^3.2.0-beta",
5050
"pace-js": "^1.0.2",
51-
"pc-bootstrap4-datetimepicker": "^4.17.50",
51+
"pc-bootstrap4-datetimepicker": "^4.17.51",
5252
"perfect-scrollbar": "^1.5.0",
5353
"places.js": "^1.19.0",
5454
"popper.js": "^1.16.1",
5555
"select2": "^4.0.13",
5656
"select2-bootstrap-theme": "0.1.0-beta.10",
57-
"simple-line-icons": "^2.4.1",
57+
"simple-line-icons": "^2.5.5",
5858
"simplemde": "^1.11.2",
5959
"source-sans-pro": "^3.6",
6060
"summernote": "^0.8.18",
6161
"sweetalert": "^2.1.2",
62-
"tinymce": "^5.4.0"
62+
"tinymce": "^5.4.2"
6363
}
6464
}

src/LicenseCheck.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ private function checkLicenseCodeExists()
4646
*/
4747
private function validCode($j)
4848
{
49-
$k = str_replace('-', '', $j); $s = substr($k, 0, 8); $c = substr($k, 8, 2); $a = substr($k, 10, 2); $l = substr($k, 12, 2); $p = substr($k, 14, 2); $n = substr($k, 16, 2); $m = substr($k, 18, 2); $z = substr($k, 20, 24); $w = 'ADEFHKLMVWXYZ146'; $x = $s; for ($i = 0; $i < strlen($w); $i++) { $r = $w[$i]; $x = str_replace($r, '-', $x); } $x = str_replace('-', '', $x); if ($x != '') { return false; } if (substr_count($j, '-') != 5) { return false; } $e = substr(crc32(substr($k, 0, 20)), -4); if ($z !== $e) { return false; } $o = strrev(substr(preg_replace('/[0-9]+/', '', strtoupper(sha1($a.'sand('.$s.')'.$n.'tos()'))), 2, 2)); if ($m !== $o) { return false; } return true;
49+
$k = str_replace('-', '', $j); $s = substr($k, 0, 8); $c = substr($k, 8, 2); $a = substr($k, 10, 2); $l = substr($k, 12, 2); $p = substr($k, 14, 2); $n = substr($k, 16, 2); $m = substr($k, 18, 2); $z = substr($k, 20, 24); $w = 'ADEFHKLMVWXYZ146'; $x = $s; for ($i = 0; $i < strlen($w); $i++) { $r = $w[$i]; $x = str_replace($r, '-', $x); } $x = str_replace('-', '', $x); if ($x != '') { return false; } if (substr_count($j, '-') != 5) { return false; } $e = substr(hexdec(hash('crc32b', substr($k, 0, 20))), -4); if ($z !== $e) { return false; } $o = strrev(substr(preg_replace('/[0-9]+/', '', strtoupper(sha1($a.'sand('.$s.')'.$n.'tos()'))), 2, 2)); if ($m !== $o) { return false; } $o2 = substr(((int)preg_replace('/[^0-9]/','', $s.$c)==0 ? 8310 : (int)preg_replace('/[^0-9]/','', $s.$c) )*9971, -2);if ($a !== $o2) {return false;} return true;
5050
}
5151
}

src/app/Http/Controllers/Operations/ListOperation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function search()
100100
// clear any past orderBy rules
101101
$this->crud->query->getQuery()->orders = null;
102102
// apply the current orderBy rules
103-
$this->crud->query->orderBy($column['name'], $column_direction);
103+
$this->crud->query->orderByRaw($this->crud->model->getTableWithPrefix().'.'.$column['name'].' '.$column_direction);
104104
}
105105

106106
// check for custom order logic in the column definition
@@ -126,7 +126,7 @@ public function search()
126126
}
127127
});
128128
if (! $hasOrderByPrimaryKey) {
129-
$this->crud->query->orderByDesc($this->crud->model->getKeyName());
129+
$this->crud->query->orderByRaw($this->crud->model->getTableWithPrefix().'.'.$this->crud->model->getKeyName().' DESC');
130130
}
131131

132132
$entries = $this->crud->getEntries();

src/app/Library/Auth/RedirectsUsers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ public function redirectPath()
1515
return $this->redirectTo();
1616
}
1717

18-
return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';
18+
return property_exists($this, 'redirectTo') ? $this->redirectTo : '/dashboard';
1919
}
2020
}

src/app/Library/CrudPanel/CrudFilter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Backpack\CRUD\app\Library\CrudPanel;
44

5+
use Closure;
56
use Illuminate\Support\Str;
67
use Symfony\Component\HttpFoundation\ParameterBag;
78

src/app/Library/CrudPanel/Traits/FieldsProtectedMethods.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ protected function overwriteFieldNameFromEntity($field)
177177
}
178178

179179
// only 1-1 relationships are supported, if it's anything else, abort
180-
if ($field['relation_type'] != 'BelongsTo') {
180+
if ($field['relation_type'] != 'HasOne') {
181181
return $field;
182182
}
183183

src/app/Library/CrudPanel/Traits/SaveActions.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,19 @@ public function getSaveActionDefaultForCurrentOperation()
2424
*/
2525
public function getFallBackSaveAction()
2626
{
27-
//we get the higher order in save actions array. It will return something only when explicit by developer
27+
//we get the higher order in save actions array. By default it would be `save_and_back`
2828
$higherAction = $this->getSaveActionByOrder(1);
2929

30-
if (empty($higherAction)) {
31-
if ($this->hasOperationSetting('defaultSaveAction')) {
32-
return $this->getOperationSetting('defaultSaveAction');
33-
}
30+
//if there is an higher action and that action is not the backpack default higher one `save_and_back` we return it.
31+
if (! empty($higherAction) && key($higherAction) !== 'save_and_back') {
32+
return key($higherAction);
33+
}
3434

35-
return $this->getSaveActionDefaultForCurrentOperation();
35+
if ($this->hasOperationSetting('defaultSaveAction')) {
36+
return $this->getOperationSetting('defaultSaveAction');
3637
}
3738

38-
return key($higherAction);
39+
return $this->getSaveActionDefaultForCurrentOperation();
3940
}
4041

4142
/**

src/app/Models/Traits/HasRelationshipFields.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use DB;
66
use Illuminate\Database\Eloquent\Model;
7-
use Illuminate\Support\Facades\Config;
87

98
/*
109
|--------------------------------------------------------------------------
@@ -39,7 +38,7 @@ public function getConnectionWithExtraTypeMappings()
3938
*/
4039
public function getTableWithPrefix()
4140
{
42-
$prefix = Config::get('database.connections.'.$this->getConnectionName().'.prefix');
41+
$prefix = $this->getConnection()->getTablePrefix();
4342
$tableName = $this->getTable();
4443

4544
return $prefix.$tableName;

0 commit comments

Comments
 (0)