thunderer / Shortcode

Advanced shortcode (BBCode) parser and engine for PHP
http://kowalczyk.cc
MIT License
378 stars 29 forks source link

Fix for PHP 7.4 error #81

Closed rhukster closed 4 years ago

rhukster commented 4 years ago

After testing Grav with PHP 7.4 this weekend, I was getting an error from Processor.php

Image 2019-12-02 at 9 32 18 AM

To pass an encoding, you must also pass an offset. 0 is default.

https://www.php.net/manual/en/function.mb-strrpos.php

mahagr commented 4 years ago

Builds fail because of PHP 5.4 and 5.5 seem to be missing. The fix should be ok for PHP 5.2+

thunderer commented 4 years ago

@rhukster thanks for the PR, I just need to check if it's possible to fix the CI to include 5.4 and 5.5, and add 7.4 while I'm at it. If not, I'll probably do the same as last time with 5.3 - these versions will still be supported, but not run in the CI.

@mahagr Since this PR fixes your issue, can you close #82?

thunderer commented 4 years ago

Hi @rhukster, thanks again for your help! Travis changed base Ubuntu distribution so that PHP 5.4 and 5.5 won't work anymore. I created a new PR #83 which includes your fix along with necessary changes for CI. I thought I'd be able to merge it excluding your fix and then let you rebase this PR on top of master, but 7.4 build fails because of the mb_strrpos() error reported here.

I would really like to credit you with this fix, so let me know if you'd like to replay the changes from #83 in your PR (just take my code and put in your branch) or are you okay with merging my PR. You know that I'm very happy having you as an active user of my library either way. :)

rhukster commented 4 years ago

don't worry about it :) just make the change the easiest way possible...

thunderer commented 4 years ago

@rhukster Thanks, I'm merging my PR then and releasing a new version shortly.

rhukster commented 4 years ago

Great thanks, i'll get a new release of the Grav shortcode-core plugin released too.

thunderer commented 4 years ago

@rhukster I merged #83 and released v0.7.3. Thanks again for reporting and fixing the issue, let me know if there is anything else I can help you with.