Skip to content

Commit 71e5d81

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 6bd0a09 + f7d4655 commit 71e5d81

File tree

305 files changed

+40735
-42639
lines changed

Some content is hidden

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

305 files changed

+40735
-42639
lines changed

.github/release-drafter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Release Drafter
2+
uses: release-drafter/[email protected]
23

34
on:
45
push:

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: 1552 additions & 1728 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 15 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.5",
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",
21-
"vue-template-compiler": "^2.6.11"
19+
"sass": "^1.26.10",
20+
"sass-loader": "^9.0.3",
21+
"vue-template-compiler": "^2.6.12"
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/FetchOperation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ protected function setupFetchOperationRoutes($segment, $routeName, $controller)
2323
if (count($matches[1])) {
2424
foreach ($matches[1] as $methodName) {
2525
Route::post($segment.'/fetch/'.Str::kebab($methodName), [
26+
'as' => $segment.'.fetch'.Str::studly($methodName),
2627
'uses' => $controller.'@fetch'.$methodName,
2728
'operation' => 'FetchOperation',
2829
]);

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: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

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

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

89
class CrudFilter
910
{
1011
public $name; // the name of the filtered variable (db column name)
1112
public $type = 'select2'; // the name of the filter view that will be loaded
13+
public $key; //camelCased version of filter name to use in internal ids, js functions and css classes.
1214
public $label;
1315
public $placeholder;
1416
public $values;
@@ -22,9 +24,6 @@ class CrudFilter
2224

2325
public function __construct($options, $values, $logic, $fallbackLogic)
2426
{
25-
//make sure we use the camel cased version of name.
26-
$options['name'] = Str::camel($options['name']);
27-
2827
// if filter exists
2928
if ($this->crud()->hasFilterWhere('name', $options['name'])) {
3029
$properties = get_object_vars($this->crud()->firstFilterWhere('name', $options['name']));
@@ -34,6 +33,7 @@ public function __construct($options, $values, $logic, $fallbackLogic)
3433
} else {
3534
// it means we're creating the filter now,
3635
$this->name = $options['name'];
36+
$this->key = Str::camel($options['name']);
3737
$this->type = $options['type'] ?? $this->type;
3838
$this->label = $options['label'] ?? $this->crud()->makeLabel($this->name);
3939
$this->viewNamespace = $options['view_namespace'] ?? $this->viewNamespace;
@@ -106,6 +106,11 @@ public function apply($input = null)
106106
$input = $input ?? new ParameterBag($this->crud()->getRequest()->all());
107107

108108
if (! $input->has($this->name)) {
109+
// if fallback logic was supplied and is a closure
110+
if (is_callable($this->fallbackLogic)) {
111+
return ($this->fallbackLogic)();
112+
}
113+
109114
return;
110115
}
111116

@@ -115,11 +120,6 @@ public function apply($input = null)
115120
} else {
116121
return $this->applyDefaultLogic($this->name, false);
117122
}
118-
119-
// if fallback logic was supplied and is a closure
120-
if (is_callable($this->fallbackLogic)) {
121-
return ($this->fallbackLogic)();
122-
}
123123
}
124124

125125
/**

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

0 commit comments

Comments
 (0)