定制 laravel-at/laravel-image-sanitize 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laravel-at/laravel-image-sanitize

最新稳定版本:v3.0.0

Composer 安装命令:

composer require laravel-at/laravel-image-sanitize

包简介

A small but handy package to prevent malicious code execution coming into your application through uploaded image files.

README 文档

README

Laravel Image Sanitize logo

It prevents malicious code execution!

Latest Version on Packagist GitHub Tests Action Status Quality Score Total Downloads

This is a small but handy package to prevent malicious code execution coming into your application through uploaded images. It was created after being inspired by @appelsiini's talk on How to Hack your Laravel Application

Installation

You can install the package via composer:

composer require laravel-at/laravel-image-sanitize

Usage

Register the ImageSanitizeMiddleware in your App\Http\Kernel class

protected $routeMiddleware = [
    // ...
    'image-sanitize' => \LaravelAt\ImageSanitize\ImageSanitizeMiddleware::class,
];

Then, just use it in your Controller's constructor

public function __construct()
{
    $this->middleware('image-sanitize');
}

Or use it in your routes/web.php file

Route::post('/files', 'FileController@upload')
    ->name('file.upload')
    ->middleware(['image-sanitize']);

If you want to learn more about middlewares, please check out the official Laravel documentation

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email adrian@nuernberger.me instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 50.38k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 249
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 248
  • Watchers: 12
  • Forks: 19
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-31