Found 45 issues

First time here? 👋

Welcome to Find a PR.

Find a PR is an open-source site that is built to help developers find projects so that they can submit their very first pull request.

If you're a contributor looking to find a project to contribute to, feel free to browse through the list below.

If you're a maintainer looking to list your project on Find a PR, you can read how to do this in the documentation.

help wanted hacktoberfest good first issue documentation

We are logging activity of several models, some using SoftDeletes trait and others not.

When we set config option 'subject_returns_soft_deleted_models' => true then calling subject() on any model not using SoftDeletes trait throws an exception: Call to undefined method Illuminate\Database\Eloquent\Builder::withTrashed().

Can the subject() method below be made to check first whether the Model uses the SoftDeletes trait? Or perhaps check whether withTrashed() is a defined method on the Model? I tried a few things but couldn't figure out how to get the class of the Model..

https://github.com/spatie/laravel-activitylog/blob/68eb6e65382f94fe86ce5ff6572159f80d024ba9/src/Models/Activity.php#L28-L35

View more
26 comments
bluec

bluec

7th Nov 2018 @ 13:44

bug unconfirmed low priority help wanted

Package

filament/filament

Package Version

v3.2

Laravel Version

v11

Livewire Version

No response

PHP Version

PHP 8.2

Problem description

I have a PostResource with a form Builder component, blocks can be reorderable with buttons only, and has two simple blocks: a paragraph and an image with a FileUpload. If I upload the images without altering the order of the block everything goes fine, the Save changes button of the form shows Uploading file and then changes back to Save changes. But if I upload an image after moving that block up or down, the Save changes button gets stuck on Uploading file. I guess a problem with the indexes.

Expected behavior

If the user uploads a file on a Builder block after changing its order, the Save changes button of the form goes back to its default state after showing Uploading file.

Steps to reproduce

On a form schema, add a reorderable (with buttons only in my case; not sure if this is relevant) Builder component with a block that has a FileUpload. In the UI, add to blocks to the Builder, move one up or down, and then upload a file on that one.

Reproduction repository

https://github.com/jmcondeprol/filament-reorderable-builder-bug.git

Relevant log output

No response

View more
2 comments
jmcondeprol

jmcondeprol

24th Apr 2024 @ 11:08

help wanted

Currently, for plural rules, the MessageFormatter polyfills uses the English rules for all locales (it ignores the locale). To be consistent with what we do in symfony/intl (used by symfony/polyfill-intl-icu to implement NumberFormatter and DateFormatter), we should rather fail explicitly here (using the English rules for a different locale would not give the right result anyway)

View more
2 comments
stof

stof

23rd Oct 2018 @ 15:34

help wanted

When encountering nested tokens, they are parsed only during formatting, not when compiling the pattern. And the type of tokens are validated only during the rendering as well. But the native implementation detects such error during the instantiation: https://3v4l.org/Sf69D This means that the error handling required for the polyfill is not the same than for the native implementation.

View more
stof

stof

23rd Oct 2018 @ 15:58

enhancement help wanted
  • standard tags
  • input fields
  • components
  • patterns

Add code snippets for each block

View more
👍 1
willemvb

willemvb

25th Jul 2016 @ 12:49

enhancement help wanted good first issue

Server is down with 503 error when loading big pdf(8Mb, 40 pages). It's because you puting file in construct method Imagick.

$this->imagick = new Imagick($pdfFile);

But why whole file if i need only one page. In method getImageData there is instruction that page is need use for generate preview.

$this->imagick->readImage(sprintf('%s[%s]', $this->pdfFile, $this->page - 1));

If you need read all file don't indicate index of page. Like this:

$this->imagick->readImage($this->pdfFile);

After then i deleted file from constructor Imagick

$this->imagick = new Imagick();

And all works fine. If you want pick another page there is method setPage

View more
2 comments
truechernyshov

truechernyshov

11th Jan 2020 @ 10:59

enhancement help wanted

Figure our a way to show a grayed out Laravel logo as a default avatar instead of the current default GitHub one.

View more
8 comments
driesvints

driesvints

29th Sep 2021 @ 10:48

help wanted findapr

I'm using Laravel 10. I've installed the package via "composer require php-flasher/flasher-laravel" Now I'm able to fire flash messages in my controller. I see them in the session data (in flasher::envelopes). But they aren't showing up in my views. In my config file I have 'auto_render' => true. If I put @flasher_render in my blade view, the only thing that's happens is, a notification to warn that this method wil be deprecated.

How can I fix this? I really like to use this package ;-)

View more
4 comments
krisc78

krisc78

9th Mar 2023 @ 14:49

enhancement help wanted

For some reason, our test suite is super slow. We should look into this and try to decrease memory usage and speed it up.

Parallel run:

  Tests:    316 passed (785 assertions)
  Duration: 13.64s
  Parallel: 10 processes

Regular run:

  Tests:    316 passed (785 assertions)
  Duration: 96.30s
View more
driesvints

driesvints

29th Dec 2023 @ 10:43

help wanted

After turning on opcache+jit, after some time an error occurs: /var/www/backend/vendor/spatie/laravel-medialibrary/src/InteractsWithMedia.php:607 Only arrays and Traversables can be unpacked

        $preparedMediaConversions = collect($this->mediaConversions)
            ->each(fn (Conversion $conversion) => $conversion->performOnCollections($mediaCollection->name))
            ->values()
            ->toArray();

->     $this->mediaConversions = [...$actualMediaConversions, ...$preparedMediaConversions];
    });
    $this->registerMediaConversions($media);
}

this only happens after some time(5+ mins of requests), when opcache+jit is enabled in logs $actualMediaConversions === false (only after opcache+jit)

Code and settings:

zend_extension=opcache.so
opcache.enable=1
opcache.enable_cli=1
opcache.jit_buffer_size=100M
opcache.jit=1235
class Compilation extends BaseCompilation implements HasMedia
{
    use InteractsWithMedia;

    const IMAGE = 'image';

    protected $hidden = [
        self::CREATED_AT,
        self::UPDATED_AT,
        'pivot'
    ];

    protected $fillable = [
        self::NAME,
        self::SLUG,
        self::IMAGE,
        self::AT_HEADER,
    ];

    protected $with = [
        'media'
    ];

    public function registerMediaCollections(): void
    {
        $this->addMediaCollection(self::IMAGE)
            ->singleFile()
            ->useFallbackUrl(
                \Storage::disk(config('disks.assets'))->url('images/dummy.png')
            )
            ->registerMediaConversions(function () {
                $this->addMediaConversion('resized')
                    ->width(400)
                    ->height(400);
            });
    }
}

View more
2 comments
izica

izica

18th Mar 2024 @ 05:57

enhancement help wanted

Hi! If I use this package with my project I has a problem. My package.json has a "git dependency" like this:

{
  "peerDependencies": {
    "package": "git+ssh://git@bitbucket.org/team/project.git"
  }
}

And npm-install-peers breaks.

View more
👍 5
JWo1F

JWo1F

18th Dec 2017 @ 08:52

enhancement help wanted hacktoberfest

Found the \Illuminate\Database\Eloquent\Concerns\HasAttributes::originalIsEquivalent() method during code diving and it should be usable for our trait! 🎉 This PR would be mainly reasearch when that method was added, if it's compatible with our version support rules and switching our own change detection logic with the core one.

View more
3 comments
Gummibeer

Gummibeer

20th Oct 2021 @ 10:03

enhancement help wanted hacktoberfest

Describe the bug I have a table which has an order column. When I reorder the elements I update each model with the new order. Because the table has some large JSON columns I select only id and order columns for efficiency. I set the new order and save the model.

foreach (Faq::query()->get(['id', 'order']) as $faq) {
    $faq->order = $newOrder[$faq->id];
    $faq->save();
}

The diffs created in the activity_log table look like this:

{
   "old": {
      "order": 1,
      "answer": null,
      "question": null
   },
   "attributes": {
      "order": 2,
      "answer": "long JSON content",
      "question": "long JSON content"
   }
}

From what I see laravel-activitylog fetches the model with all columns from the database before creating a log entry which kind of defeats the purpose of my "select list optimization" and produces an incorrect diff.

Generally I want these large JSON columns to be logged in case a user changes them but in this case I only change the order column so I would like to see only the order column in the diff.

I have tried running these updates straight off the Eloquent builder:

Faq::query()->where('id', $id)->update(['order' => $newOrder[$id]]);

but in this case nothing is logged.

I have the following activitylog configuration for my models:

public function getActivitylogOptions(): LogOptions
{
    return LogOptions::defaults()
                     ->logAll()
                     ->logOnlyDirty()
                     ->logExcept([
                         'id',
                         'created_at',
                         'updated_at',
                     ]);
}

To Reproduce Select a subset of columns from the database, change these columns, save the model and see that other (not initially selected) columns are present in the diff.

Expected behavior Only columns that've actually been changed should be present in the diff.

Versions

  • PHP: 8.1
  • Database: MySQL 8
  • Laravel: 9.31.0
  • Package: 4.6.0
View more
5 comments
KKSzymanowski

KKSzymanowski

28th Sep 2022 @ 21:53

help wanted findapr
  public function bell()
    {
        $this->count += 1;
        flash()->addInfo('Your information has been saved and a confirmation email has been sent.');
    }

This flash message doesn't show up until I reload the page If I reload the page then what's is the point of using livewire

View more
12 comments 👍 1
codebyshami

codebyshami

17th Nov 2023 @ 01:19

bug unconfirmed low priority help wanted

Package

filament/spatie-laravel-media-library-plugin

Package Version

v3.2.70

Laravel Version

v11.4.0

Livewire Version

No response

PHP Version

8.3.6

Problem description

I have a wizard that saves some data on User, and some data on Profile which belongs to a user.

The fields that are related to Profile are put on two different steps of a Wizard inside a Fieldset with relationship method pointing to the HasOne profile relationship on User model.

It works fine if I only have one fieldset linked to this relationship, but breaks when I have two. This only happens with SpatieMediaLibraryFileUpload component. Normal fields work fine. They are on the same relationship, but I've used different names in the make method.

Cloning the relationship works, but this is a nasty hacky fix. Any way we can avoid that?

Expected behavior

SpatieMediaLibraryFileUpload should also just work like other form fields on related models.

Steps to reproduce

  1. Have two related models
  2. Create two fieldsets on the related model inside a form
  3. Put SpatieMediaLibraryFileUpload components in one of the fieldsets

Reproduction repository

https://github.com/mokhosh/filament-medialibrary-multiple-fieldset-bug

Relevant log output

No response

View more
4 comments
mokhosh

mokhosh

19th Apr 2024 @ 10:37

help wanted

Hello,

I noticed that there is an incompatibility with the mbstring polyfill and PHP 8.1 / Alpine Linux, which breaks a lot of my projects as soon as the php81-mbstring is not installed, but php81-iconv is installed:

Example:

Warning: iconv(): Wrong encoding, conversion from "ASCII" to "UTF-8//IGNORE" is not allowed in phar:///var/www/localhost/htdocs/phpstan.phar/vendor/symfony/polyfill-mbstring/Mbstring.php on line 736

It looks like //IGNORE is not accepted since echo iconv('UTF-8', 'UTF-8', 'test'); works, while echo iconv('UTF-8', 'UTF-8//IGNORE', 'test'); doesn't

View more
2 comments
danielmarschall

danielmarschall

7th Jan 2022 @ 00:12

help wanted

Laravel Version

11.6.0

PHP Version

8.2.4

Database Driver & Version

mysql

Description

I have observed an unexpected behavior with the loadCount method. The loadCount method is intended to load the count of related models without firing the retrieved event on the parent model, similar to how withCount operates. However, it appears to be triggering the retrieved event for the parent model with invalid data. The following is the log for the retrieved event for Post and Comment model:

[2024-05-03 07:50:29] local.INFO: Retrieved model:  {"id":1,"title":"Commodi voluptatem hic rem iure consectetur temporibus aut.","body":"Itaque magnam ea quo nulla et. Minima vel quo cupiditate culpa rerum. Et iusto enim dolorum. Explicabo dolor mollitia officia in ea.","created_at":"2024-05-03T07:33:54.000000Z","updated_at":"2024-05-03T07:33:54.000000Z"} 
[2024-05-03 07:50:29] local.INFO: Retrieved model:  {"id":1,"comments_count":3} 

which triggers from this route:

Route::get('/', function () {
    $post = \App\Models\Post::first();
    $post->loadCount('comments');

    dd('DONE! Checkout the storage/logs/laravel.log file');
});

the Post model retrieved event handler:

protected static function booted(): void
{
    static::retrieved(function($model) {
        info('Retrieved model: ', $model->toArray());
    });
}

Steps To Reproduce

  1. Clone this repository: https://github.com/AmRo045/laravel-bug-report-load-count and set up the basics.
  2. Run the migrations.
  3. Create a fake post with some comments using tinker and the following snippet:
\App\Models\Post::factory()->hasComments(3)->create();
  1. Start the server and navigate to the home page.
  2. Check the storage/logs/laravel.log file.
View more
2 comments
AmRo045

AmRo045

3rd May 2024 @ 08:21

help wanted

NotOrm Package

The goal is to make abstract code based on the package notorm to build a new orm system

View more
ambroisehdn

ambroisehdn

15th Jun 2022 @ 12:34

help wanted

Hi,

we just upgraded to v11 from v10. All working fine except conversions and image manipulations are working super slow (2 mins comparing to 1 second) with "imagick" driver.

We use PHP 8.2.15, imagick 3.7.0 (installed via pecl). Changing driver to gd provides better results, but still about 6-7 seconds, not 1 sec as before. We have feature tests, and now all tests with image manipulations processed about 130-150secs instead of 5-6secs.

I'm not sure how to reproduce the bug, here are our settings:

$this
    ->addMediaCollection('hero')
    ->useDisk($publicDisk)
    ->singleFile()
    ->registerMediaConversions(function (Media $media) {
        $this->addMediaConversion('backoffice')
            ->fit(...config('media-library.defaults_conversions.backoffice'))
            ->nonQueued();

        $this
            ->addMediaConversion('thumb')
            ->fit(...config('media-library.defaults_conversions.thumb'));

        $this
            ->addMediaConversion('hd')
            ->withResponsiveImages()
            ->fit(...config('media-library.defaults_conversions.hd'));

        $this->addMediaConversion('thumb_sm')
            ->fit(...config('media-library.offerings_conversions.thumb_sm'));
        $this->addMediaConversion('thumb_lg')
            ->fit(...config('media-library.offerings_conversions.thumb_lg'));
    });

and the configs:

    'defaults_conversions' => [
        'backoffice' => [Fit::Crop, 100, 50],
        'thumb' => [Fit::Crop, 720, 420],
        'hd' => [Fit::Crop, 1920, 1080],
    ],

    'offerings_conversions' => [
        'thumb_sm' => [Fit::Crop, 431, 307],
        'thumb_lg' => [Fit::Crop, 720, 775],
    ],
View more
3 comments
aprokopenko

aprokopenko

15th Apr 2024 @ 08:57

help wanted

I would be good to support normalizer_get_raw_decomposition function that appeared in PHP 7.3. I've tried to implement it but seems that existing decomposition data is already optimized to get the final decomposition. Example test case is available here. Pinging @nicolas-grekas as he is the author of Normalizer polyfill.

View more
4 comments
IonBazan

IonBazan

12th May 2018 @ 23:26

Feature help wanted

Calling for help from Docker experts. We need to create the best possible docker-compose.yml file for this project. The application requirements are well defined (we use env vars, Webpack Encore, PHP 7.1, Symfony 4.1, SQLite database, etc.) so it should be possible to create that file.

View more
30 comments 👍 28
javiereguiluz

javiereguiluz

21st May 2018 @ 09:37

help wanted good first issue

This concerns https://github.com/spatie/laravel-medialibrary/pull/2784

I noticed in our old admin panel that we had a lot of lazy loaded media relations. We didn't get a warning about it (for 2 years 😄), even with Model::preventLazyLoading(); enabled globally. The cause for this is that doing loadMissing() on each object in a loop doesn't trigger the exception even though it's technically an n+1 issue.

The solution to this is to always eager load relations manually in the controller, not in models or traits. Removing this would be a breaking change, but are you open to it? I expect a lot of package users have tons of n+1 media issues but aren't aware, unless you manually inspect the debug bar queries for each page you use media in collections.

View more
2 comments 👍 2
sebastiaanluca

sebastiaanluca

27th Feb 2024 @ 17:28

findapr

Im using PHPFlasher in a symfony application however it adds session state when not in use. I am combining it with API Platform and my API itself it stateless so it should not hold any session data (causes errors).

How should i handle this (if even possible?)

View more
13 comments
pimjansen

pimjansen

2nd Jun 2023 @ 12:24

help wanted

Add in PHP 7.3 as Normalizer::normalize() argument for NFKC_Casefold normalization.

View more
1 comment
nicolas-grekas

nicolas-grekas

7th Feb 2019 @ 10:11

help wanted

Laravel Version

11.0.7

PHP Version

8.3.3

Database Driver & Version

No response

Description

This is a little tricky, but I ran into this issue after upgrading to Laravel 11 and first suspected it was a problem with Blade Heroicons Kit.

In Laravel 11 the optimize command was extended to cache events and views.

When running optimize on a fresh app with the Heroicons kit it blew up:

➜  heroicons php artisan optimize

   INFO  Caching framework bootstrap, configuration, and metadata.  

  config ............................................................................................................................... 7.62ms DONE
  events ............................................................................................................................... 0.71ms DONE
  routes ............................................................................................................................... 5.56ms DONE
  views ............................................................................................................................... 28.61ms FAIL

   InvalidArgumentException 

  Unable to locate a class or view for component [heroicon-s-bars-3].

  at vendor/laravel/framework/src/Illuminate/View/Compilers/ComponentTagCompiler.php:311
    307▕         if (Str::startsWith($component, 'mail::')) {
    308▕             return $component;
    309▕         }
    310▕ 
  ➜ 311▕         throw new InvalidArgumentException(
    312▕             "Unable to locate a class or view for component [{$component}]."
    313▕         );
    314▕     }
    315▕ 

      +2 vendor frames 

  3   [internal]:0
      Illuminate\View\Compilers\ComponentTagCompiler::Illuminate\View\Compilers\{closure}(["<x-heroicon-s-bars-3 />", "heroicon-s-bars-3", "", ""])
      +7 vendor frames 

  11  [internal]:0
      Illuminate\Foundation\Console\ViewCacheCommand::Illuminate\Foundation\Console\{closure}(Object(Symfony\Component\Finder\SplFileInfo), "/Users/dwight/Sites/heroicons/resources/views/welcome.blade.php")

However, running php artisan view:cache runs fine.

Through playing with the optimize command I realised two things:

  • If I comment out config or route caching from optimize then it works fine. Something that happens in the config:cache or route:cache command is affecting what happens in the view:cache command.
  • The instance of the BladeCompiler from the container and the one that is received inside the ViewCacheCommand appear to be different (and the second doesn't have the Heroicon aliases available)

Steps To Reproduce

laravel new heroicons
cd heroicons
composer require blade-ui-kit/blade-heroicons

Add an icon to the welcome page: <x-heroicon-s-bars-3 />

View more
4 comments 👍 1
dwightwatson

dwightwatson

18th Mar 2024 @ 08:58

enhancement help wanted

Discussed in https://github.com/spatie/schema-org/discussions/202

Originally posted by indyjonesnl January 10, 2024

$lodgingBusiness = Schema::lodgingBusiness()
  ->openingHours(
    Schema::openingHoursSpecification()
      ->dayOfWeek([Schema::dayOfWeek()::Monday])
      ->opens(new DateTime('09:00:00'))
      ->closes(new DateTime('17:00:00'))
  )
  ->checkinTime(new DateTime('14:00:00'))
  ->checkoutTime(new DateTime('11:00:00'))

This results in the current date + time being included in the output "opens":"2024-01-10T09:00:00+00:00","closes":"2024-01-10T17:00:00+00:00" and ..."checkinTime":"2024-01-10T14:00:00+00:00","checkoutTime":"2024-01-10T11:00:00+00:00"...

While the Schema should contain only the time, formatted as 14:30:00+08:00.

Can someone point me in the right direction?

View more
Gummibeer

Gummibeer

11th Jan 2024 @ 13:12

help wanted findapr

I found some issues after the version 2 upgrade on Laravel 11:

  • Config inject_assets doesn't affect the rendering.
  • Config timeout is no longer working and I have to set it for every request
  • The option for replacing Laravel default flash is removed, and can't be changed unlike version 1, while the only way to skip this is by using other flash names except (success, error, warning, and info) which means changing a lot of code for existing apps.
  • Changing flash_bag in the config doesn't override the default bags but adds new values to the default array.
  • When using the Laravel default flash with the bags (success, error, warning, info) the php-flasher fires after reloading the page (after the flash expires).

If version 2 main concept is to replace the default Laravel flash without an option to disable it, I know that downgrading should be the proper solution but unfortunately, this also will not be a good solution because version 1 with Laravel 11 disables the default flash option entirely and also have to rewrite a lot of code to change it to php-flasher and that why I upgraded to version 2 in the first place.

View more
2 comments ❤️ 1
AhmedGamal

AhmedGamal

22nd May 2024 @ 19:31

help wanted

Laravel Version

10.46.0

PHP Version

8.1.27

Database Driver & Version

No response

Description

We've identified an issue whereby in multi-server environments where commands are scheduled to run using withoutOverlapping() and onOneServer(), the commands will very occasionally not run at all on any server (about 0.2% of the time in our environment). Not a problem for things running every minute where we first spotted the problem, but more impactful when things running a few times or once per day are skipped.

Just going to start with outlining my understanding of how scheduled commands get run when withoutOverlapping() and onOneServer() are used:

  • Commands due to run are iterated over (ScheduleRunCommand::handle, L121)
  • Each command is checked to ensure filters pass before proceeding (ScheduleRunCommand::handle, L122)
    • Because we used withoutOverlapping() a check is added to the filters to ensure the event mutex lock does not currently exist (Event::withoutOverlapping, L713)
  • For each command that passes the filters (i.e. considered to be not currently running), serverShouldRun() is then called to check for and take a scheduling lock for the current server to run the command for the current hour/minute (ScheduleRunCommand::runSingleServerEvent, L156)
  • Once confirmed that the event is not currently running and the server has the lock to run the event for the current schedule run, Event::run is called (Event::run, L217)
  • As a final check before the event runs, shouldSkipDueToOverlapping() is called which checks whether withoutOverlapping() was used and checks that the event lock can be obtained (Event::shouldSkipDueToOverlapping, L237)

Just for clarity, there's two locks in play;

  • The event lock which is used by withoutOverlapping() to identify whether a command is already being run.
  • The scheduling lock used by onOneSever() to check whether a command has already been run on a server for the current schedule run (identified by the current hour and minute.)

The problem stems from the way in which the event mutex lock is checked for existence, which was introduced in PR #45963.

Originally, the CacheEventMutex would just check if the cache had an entry for the lock (CacheEventMutex::exists, L69) which worked fine, but PR #45963 changed that behavior. For cache stores that implement the LockProvider interface (Redis, Memcached) it now attempts to get the lock and then immediately releases it again (but this is not done atomically.)

So the race condition looks something like this if Server B's system clock is just slightly slower than Server A:

Time Server A Server B
12:00:00 Checking that Event A is not currently running, takes event lock for Event A
12:00:01 Releases event lock for Event A, determining that it is not currently running so should be run
12:00:02 Takes scheduling lock for Event A to run on Server A
12:00:03 Checking that Event A is not currently running, takes event lock for Event A
12:00:04 Attempts to take the event lock for Event A to run it, fails because Server B has the lock, then skips due to overlapping
12:00:05 Releases event lock for Event A, determining that it is not currently running so should be run
12:00:06 Attempts to take scheduling lock for Event A to run on Server B, fails as the scheduling lock was already taken by Server A, skips assuming command was run on another server already

So in this scenario the scheduled command is never run, there's no error message, and the ScheduledTaskSkipped doesn't even get fired because the call to run() just returns if shouldSkipDueToOverlapping() returns true.

In terms of a solution, it might make sense to be able to check for the existence of a lock without taking and releasing it, maybe a new abstract exists() on Lock (https://github.com/laravel/framework/blob/10.x/src/Illuminate/Cache/Lock.php) which CacheEventMutex could use and RedisLock/MemcachedLock could implement their own atomic means of checking for lock existence, although that probably constitutes a backwards-compatibility break. Happy to put together a PR for whatever the agreed solution is.

As a workaround, I've just bound an older version of CacheEventMutex to Illuminate\Console\Scheduling\EventMutex to override the changes implemented in #45963 which has solved the issue in our project for now.

Steps To Reproduce

Given its a race condition its very hard to reproduce, but hopefully there's enough details in the description to understand what's going on.

View more
4 comments 👀 2
nickma42

nickma42

1st Mar 2024 @ 15:30

help wanted

When calling mb_convert_encoding() with $fromEncoding === 'HTML-ENTITIES', the polyfill does not return functionally equivalent strings to the native function. This is because mb_convert_encoding() uses