1
0
mirror of https://github.com/flarum/core.git synced 2025-08-11 02:44:04 +02:00

chore(deps): bump glob-parent from 3.1.0 to 5.1.2 in /extensions/emoji/js (#3345)

* chore(deps): bump glob-parent in /extensions/emoji/js

Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 3.1.0 to 5.1.2.
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v3.1.0...v5.1.2)

---
updated-dependencies:
- dependency-name: glob-parent
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Apply fixes from StyleCI

[ci skip] [skip ci]

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
This commit is contained in:
dependabot[bot]
2022-03-11 18:11:20 -05:00
committed by GitHub
parent 379c06332a
commit 37a882118a
128 changed files with 9645 additions and 11730 deletions

View File

@@ -1,12 +1,10 @@
<?php
/*
* This file is part of flarum/nickname.
* This file is part of Flarum.
*
* Copyright (c) 2020 Flarum.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Nicknames;
@@ -21,12 +19,12 @@ use Flarum\User\UserValidator;
return [
(new Extend\Frontend('forum'))
->js(__DIR__ . '/js/dist/forum.js'),
->js(__DIR__.'/js/dist/forum.js'),
(new Extend\Frontend('admin'))
->js(__DIR__ . '/js/dist/admin.js'),
->js(__DIR__.'/js/dist/admin.js'),
new Extend\Locales(__DIR__ . '/locale'),
new Extend\Locales(__DIR__.'/locale'),
(new Extend\User())
->displayNameDriver('nickname', NicknameDriver::class),

View File

@@ -1,18 +1,25 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [
'up' => function(Builder $schema) {
if (!$schema->hasColumn('users', 'nickname')) {
$schema->table('users', function (Blueprint $table) use ($schema) {
'up' => function (Builder $schema) {
if (! $schema->hasColumn('users', 'nickname')) {
$schema->table('users', function (Blueprint $table) {
$table->string('nickname', 150)->after('username')->index()->nullable();
});
}
},
'down' => function(Builder $schema) {
$schema->table('users', function (Blueprint $table) use ($schema) {
'down' => function (Builder $schema) {
$schema->table('users', function (Blueprint $table) {
$table->dropColumn('nickname');
});
}

View File

@@ -1,5 +1,12 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;

View File

@@ -32,11 +32,11 @@ class UserPolicy extends AbstractPolicy
*/
public function editNickname(User $actor, User $user)
{
if ($actor->isGuest() && !$user->exists && $this->settings->get('flarum-nicknames.set_on_registration')) {
if ($actor->isGuest() && ! $user->exists && $this->settings->get('flarum-nicknames.set_on_registration')) {
return $this->allow();
} else if ($actor->id === $user->id && $actor->hasPermission('user.editOwnNickname')) {
} elseif ($actor->id === $user->id && $actor->hasPermission('user.editOwnNickname')) {
return $this->allow();
} else if ($actor->can('edit', $user)) {
} elseif ($actor->can('edit', $user)) {
return $this->allow();
}
}

View File

@@ -1,5 +1,11 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Nicknames;
@@ -19,7 +25,6 @@ class AddNicknameValidation
*/
protected $translator;
public function __construct(SettingsRepositoryInterface $settings, TranslatorInterface $translator)
{
$this->settings = $settings;
@@ -34,12 +39,12 @@ class AddNicknameValidation
$rules['nickname'] = [
function ($attribute, $value, $fail) {
$regex = $this->settings->get('flarum-nicknames.regex');
if ($regex && !preg_match_all("/$regex/", $value)) {
if ($regex && ! preg_match_all("/$regex/", $value)) {
$this->translator->trans('flarum-nicknames.api.invalid_nickname_message');
}
},
'min:' . $this->settings->get('flarum-nicknames.min'),
'max:' . $this->settings->get('flarum-nicknames.max'),
'min:'.$this->settings->get('flarum-nicknames.min'),
'max:'.$this->settings->get('flarum-nicknames.max'),
'nullable'
];

View File

@@ -1,12 +1,19 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Nicknames;
use Flarum\User\DisplayName\DriverInterface;
use Flarum\User\User;
class NicknameDriver implements DriverInterface {
class NicknameDriver implements DriverInterface
{
public function displayName(User $user): string
{
return $user->nickname ? $user->nickname : $user->username;

View File

@@ -1,5 +1,11 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Nicknames;
@@ -14,7 +20,6 @@ use Flarum\Search\GambitInterface;
use Flarum\Search\SearchState;
use Flarum\User\UserRepository;
class NicknameFullTextGambit implements GambitInterface
{
/**
@@ -40,7 +45,7 @@ class NicknameFullTextGambit implements GambitInterface
->query()
->select('id')
->where('username', 'like', "{$searchValue}%")
->orWhere('nickname', 'like',"{$searchValue}%");
->orWhere('nickname', 'like', "{$searchValue}%");
}
/**

View File

@@ -1,19 +1,27 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Nicknames;
use Flarum\Settings\SettingsRepositoryInterface;
use Flarum\User\Event\Saving;
use Flarum\User\Exception\PermissionDeniedException;
use Illuminate\Support\Arr;
class SaveNicknameToDatabase {
class SaveNicknameToDatabase
{
/**
* @var SettingsRepositoryInterface
*/
protected $settings;
public function __construct(SettingsRepositoryInterface $settings) {
public function __construct(SettingsRepositoryInterface $settings)
{
$this->settings = $settings;
}