Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[5.8] Fix appending path to inline Blade views #28141
When appending the view path to Blade views with only one line and opening tags we should take into consideration for closing the PHP tag first before appending the path. I've added tests which should cover quite a few situations.
Thanks to Sisve for making me aware of this: #28117 (comment)
referenced this pull request
Apr 8, 2019
@fitztrev good call. Added this.
@fitztrev I get an error when I try to render this in a blade view. I believe closing tags are always needed which makes some of my tests unnecessary actually.
Here's valid code that does not work under the latest change.
<?php echo '<?xml version="1.0" encoding="UTF-8"?>';
Here's a failing test for it:
'Echo XML declaration' => [ '<?php echo \'<?xml version="1.0" encoding="UTF-8"?>\';', '<?php echo \'<?xml version="1.0" encoding="UTF-8"?>\'; ?><?php /**PATH foo ENDPATH**/ ?>', ],
@fitztrev Pushed a commit which should take into account all scenarios now. Made use of the tokenizer extension to check for the opening and closing tags. I didn't add a test for the short tags because it will fail if they're not enabled but they should be covered as well now.