Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Fix for attributes being escaped on Dynamic Blade Components #50471

Merged
merged 1 commit into from
Mar 12, 2024
Merged

[10.x] Fix for attributes being escaped on Dynamic Blade Components #50471

merged 1 commit into from
Mar 12, 2024

Conversation

pascalbaljet
Copy link
Contributor

I understand this is an edge case, but I'm extending the DynamicComponent class as I needed some helper methods there:

use Illuminate\View\DynamicComponent;

class CustomComponent extends DynamicComponent
{
    // custom helper methods...
}

Since v10.48, it fails to pass attributes. This code snippet results in Argument #1 ($name) must be of type string, null given:

<x-custom-component :component="$componentName" :name="$name" />

The attributes are filtered out in attributesToStringWithExistingComponentData() (see #50403), except for Dynamic Components. However, it only checks for the exact class name, not for subclasses of DynamicComponent. This PR fixes that.

@taylorotwell taylorotwell merged commit 40c32ce into laravel:10.x Mar 12, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants