forked from codeigniter4/CodeIgniter4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
325 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Config; | ||
|
||
use CodeIgniter\Config\Publisher as BasePublisher; | ||
|
||
/** | ||
* Publisher Configuration | ||
* | ||
* Defines basic security restrictions for the Publisher class | ||
* to prevent abuse by injecting malicious files into a project. | ||
*/ | ||
class Publisher extends BasePublisher | ||
{ | ||
/** | ||
* A list of allowed destinations with a (pseudo-)regex | ||
* of allowed files for each destination. | ||
* Attempts to publish to directories not in this list will | ||
* result in a PublisherException. Files that do no fit the | ||
* pattern will cause copy/merge to fail. | ||
* | ||
* @var array<string,string> | ||
*/ | ||
public $restrictions = [ | ||
ROOTPATH => '*', | ||
FCPATH => '#\.(?css|js|map|htm?|xml|json|webmanifest|tff|eot|woff?|gif|jpe?g|tiff?|png|webp|bmp|ico|svg)$#i', | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the CodeIgniter 4 framework. | ||
* | ||
* (c) CodeIgniter Foundation <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace CodeIgniter\Config; | ||
|
||
/** | ||
* Publisher Configuration | ||
* | ||
* Defines basic security restrictions for the Publisher class | ||
* to prevent abuse by injecting malicious files into a project. | ||
*/ | ||
class Publisher extends BaseConfig | ||
{ | ||
/** | ||
* A list of allowed destinations with a (pseudo-)regex | ||
* of allowed files for each destination. | ||
* Attempts to publish to directories not in this list will | ||
* result in a PublisherException. Files that do no fit the | ||
* pattern will cause copy/merge to fail. | ||
* | ||
* @var array<string,string> | ||
*/ | ||
public $restrictions = [ | ||
ROOTPATH => '*', | ||
FCPATH => '#\.(?css|js|map|htm?|xml|json|webmanifest|tff|eot|woff?|gif|jpe?g|tiff?|png|webp|bmp|ico|svg)$#i', | ||
]; | ||
|
||
/** | ||
* Disables Registrars to prevent modules from altering the restrictions. | ||
*/ | ||
final protected function registerProperties() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.