Skip to content

Commit a7dbdd7

Browse files
committed
Update
1 parent 66eb484 commit a7dbdd7

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

app/Http/Controllers/Dashboard/CrudController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ public function crudPost( String $namespace, CrudPostRequest $request )
119119
* sanitizing input to remove
120120
* all script tags
121121
*/
122-
$entry->$name = preg_replace( '#<script(.*?)>(.*?)</script>#is', '', $entry->$name );
122+
if ( ! empty( $entry->$name ) ) {
123+
$entry->$name = preg_replace( '#<script(.*?)>(.*?)</script>#is', null, $entry->$name );
124+
}
123125
}
124126

125127
/**
@@ -240,7 +242,9 @@ public function crudPut( String $namespace, $id, CrudPutRequest $request )
240242
* sanitizing input to remove
241243
* all script tags
242244
*/
243-
$entry->$name = preg_replace( '#<script(.*?)>(.*?)</script>#is', '', $entry->$name );
245+
if ( ! empty( $entry->$name ) ) {
246+
$entry->$name = preg_replace( '#<script(.*?)>(.*?)</script>#is', null, $entry->$name );
247+
}
244248
}
245249

246250
/**

storage/app/public/index.html

100644100755
File mode changed.

tests/Feature/OrderRefundTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class OrderRefundTest extends TestCase
2121
*
2222
* @return void
2323
*/
24-
public function testExample()
24+
public function testRefund()
2525
{
2626
Sanctum::actingAs(
2727
Role::namespace( 'admin' )->users->first(),

0 commit comments

Comments
 (0)