Skip to content

Commit

Permalink
Merge pull request #5 from laravel/5.8
Browse files Browse the repository at this point in the history
Merge latest 5.8
  • Loading branch information
troccoli authored Jul 10, 2019
2 parents c84e44d + d3d2116 commit a5bf6ab
Show file tree
Hide file tree
Showing 330 changed files with 5,832 additions and 1,405 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.styleci.yml export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
CHANGELOG-* export-ignore
CODE_OF_CONDUCT.md export-ignore
CONTRIBUTING.md export-ignore
phpunit.xml.dist export-ignore
10 changes: 10 additions & 0 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Support

This repository is only for reporting bugs or issues. If you need support, please use the forums:

- https://laracasts.com/discuss
- https://laravel.io/forum

Alternatively, you may use [Slack](https://larachat.co/), [Discord](https://discordapp.com/invite/mPZNm7A), or [Stack Overflow](http://stackoverflow.com/questions/tagged/laravel).

Thanks!
7 changes: 7 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
php:
preset: laravel
js:
finder:
not-name:
- webpack.mix.js
css: true
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
before_install:
- phpenv config-rm xdebug.ini || true
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- printf "\n" | pecl install -f redis
- printf "\n" | pecl install -f redis-4.3.0
- travis_retry composer self-update
- mysql -e 'CREATE DATABASE forge;'

Expand Down
341 changes: 340 additions & 1 deletion CHANGELOG-5.8.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Laravel is a web application framework with expressive, elegant syntax. We belie
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).

Laravel is accessible, yet powerful, providing tools needed for large, robust applications. A superb combination of simplicity, elegance, and innovation gives you a complete toolset required to build any application with which you are tasked
Laravel is accessible, yet powerful, providing tools needed for large, robust applications. A superb combination of simplicity, elegance, and innovation gives you a complete toolset required to build any application with which you are tasked.

## Learning Laravel

Expand All @@ -38,7 +38,7 @@ In order to ensure that the Laravel community is welcoming to all, please review

## Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [[email protected]](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
Please review [our security policy](https://github.com/laravel/framework/security/policy) on how to report security vulnerabilities.

## License

Expand Down
26 changes: 19 additions & 7 deletions ...UE_TEMPLATE/5_Security_vulnerabilities.md → SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
---
name: "🔒 Security Vulnerabilities"
about: 'For reporting security-related issues, see: https://github.com/laravel/laravel#security-vulnerabilities'
# Security Policy

---
**PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY, [SEE BELOW](#reporting-a-vulnerability).**

PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY, SEE BELOW.
## Supported Versions

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [email protected]. All security vulnerabilities will be promptly addressed.
Version | Security Fixes Until
--- | ---
5.8 | February 26th, 2020
5.7 | September 4th, 2019
5.6 | February 7th, 2019
5.5 (LTS) | August 30th, 2020
5.4 | January 24th, 2018
5.3 | August 23rd, 2017
5.2 | December 21st, 2016
5.1 (LTS) | June 9th, 2018
5.0 | February 4th, 2016

Public PGP Key:
## Reporting a Vulnerability

If you discover a security vulnerability within Laravel, please send an email to Taylor Otwell at [email protected]. All security vulnerabilities will be promptly addressed.

### Public PGP Key

```
-----BEGIN PGP PUBLIC KEY BLOCK-----
Expand Down
18 changes: 11 additions & 7 deletions src/Illuminate/Auth/Access/Gate.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,11 @@ public function define($ability, $callback)
public function resource($name, $class, array $abilities = null)
{
$abilities = $abilities ?: [
'view' => 'view',
'create' => 'create',
'update' => 'update',
'delete' => 'delete',
'viewAny' => 'viewAny',
'view' => 'view',
'create' => 'create',
'update' => 'update',
'delete' => 'delete',
];

foreach ($abilities as $ability => $method) {
Expand Down Expand Up @@ -417,6 +418,8 @@ protected function methodAllowsGuests($class, $method)
*
* @param callable $callback
* @return bool
*
* @throws \ReflectionException
*/
protected function callbackAllowsGuests($callback)
{
Expand Down Expand Up @@ -527,7 +530,6 @@ protected function resolveAuthCallback($user, $ability, array $arguments)
}

return function () {
return null;
};
}

Expand Down Expand Up @@ -599,6 +601,8 @@ public function guessPolicyNamesUsing(callable $callback)
*
* @param object|string $class
* @return mixed
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function resolvePolicy($class)
{
Expand Down Expand Up @@ -653,7 +657,7 @@ protected function resolvePolicyCallback($user, $ability, array $arguments, $pol
protected function callPolicyBefore($policy, $user, $ability, $arguments)
{
if (! method_exists($policy, 'before')) {
return null;
return;
}

if ($this->canBeCalledWithUser($user, $policy, 'before')) {
Expand All @@ -680,7 +684,7 @@ protected function callPolicyMethod($policy, $method, $user, array $arguments)
}

if (! is_callable([$policy, $method])) {
return null;
return;
}

if ($this->canBeCalledWithUser($user, $policy, $method)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Auth/AuthManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct($app)
/**
* Attempt to get the guard from the local cache.
*
* @param string $name
* @param string|null $name
* @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard
*/
public function guard($name = null)
Expand Down
24 changes: 20 additions & 4 deletions src/Illuminate/Auth/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ class AuthServiceProvider extends ServiceProvider
public function register()
{
$this->registerAuthenticator();

$this->registerUserResolver();

$this->registerAccessGate();

$this->registerRequestRebindHandler();
$this->registerEventRebindHandler();
}

/**
Expand Down Expand Up @@ -75,7 +73,7 @@ protected function registerAccessGate()
}

/**
* Register a resolver for the authenticated user.
* Handle the re-binding of the request binding.
*
* @return void
*/
Expand All @@ -87,4 +85,22 @@ protected function registerRequestRebindHandler()
});
});
}

/**
* Handle the re-binding of the event dispatcher binding.
*
* @return void
*/
protected function registerEventRebindHandler()
{
$this->app->rebinding('events', function ($app, $dispatcher) {
if (! $app->resolved('auth')) {
return;
}

if (method_exists($guard = $app['auth']->guard(), 'setDispatcher')) {
$guard->setDispatcher($dispatcher);
}
});
}
}
19 changes: 16 additions & 3 deletions src/Illuminate/Auth/Console/AuthMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ public function handle()
*/
protected function createDirectories()
{
if (! is_dir($directory = resource_path('views/layouts'))) {
if (! is_dir($directory = $this->getViewPath('layouts'))) {
mkdir($directory, 0755, true);
}

if (! is_dir($directory = resource_path('views/auth/passwords'))) {
if (! is_dir($directory = $this->getViewPath('auth/passwords'))) {
mkdir($directory, 0755, true);
}
}
Expand All @@ -91,7 +91,7 @@ protected function createDirectories()
protected function exportViews()
{
foreach ($this->views as $key => $value) {
if (file_exists($view = resource_path('views/'.$value)) && ! $this->option('force')) {
if (file_exists($view = $this->getViewPath($value)) && ! $this->option('force')) {
if (! $this->confirm("The [{$value}] view already exists. Do you want to replace it?")) {
continue;
}
Expand All @@ -117,4 +117,17 @@ protected function compileControllerStub()
file_get_contents(__DIR__.'/stubs/make/controllers/HomeController.stub')
);
}

/**
* Get full view path relative to the app's configured view path.
*
* @param string $path
* @return string
*/
protected function getViewPath($path)
{
return implode(DIRECTORY_SEPARATOR, [
config('view.paths')[0] ?? resource_path('views'), $path,
]);
}
}
16 changes: 8 additions & 8 deletions src/Illuminate/Auth/Console/stubs/make/views/auth/login.stub
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>

<div class="col-md-6">
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required autofocus>
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>

@if ($errors->has('email'))
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('email') }}</strong>
<strong>{{ $message }}</strong>
</span>
@endif
@enderror
</div>
</div>

<div class="form-group row">
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>

<div class="col-md-6">
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">

@if ($errors->has('password'))
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('password') }}</strong>
<strong>{{ $message }}</strong>
</span>
@endif
@enderror
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>

<div class="col-md-6">
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required>
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>

@if ($errors->has('email'))
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('email') }}</strong>
<strong>{{ $message }}</strong>
</span>
@endif
@enderror
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>

<div class="col-md-6">
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ $email ?? old('email') }}" required autofocus>
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ $email ?? old('email') }}" required autocomplete="email" autofocus>

@if ($errors->has('email'))
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('email') }}</strong>
<strong>{{ $message }}</strong>
</span>
@endif
@enderror
</div>
</div>

<div class="form-group row">
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>

<div class="col-md-6">
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password">

@if ($errors->has('password'))
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('password') }}</strong>
<strong>{{ $message }}</strong>
</span>
@endif
@enderror
</div>
</div>

<div class="form-group row">
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>

<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password">
</div>
</div>

Expand Down
Loading

0 comments on commit a5bf6ab

Please sign in to comment.