Heyuri / kokonotsuba

Heyuri's BBS software
Other
19 stars 12 forks source link

PHP7.2-PHP8.3 #62

Closed satopian closed 9 months ago

satopian commented 9 months ago

https://github.com/satopian/kokonotsuba This is a sample that also works with PHP7.2, PHP7.3, PHP7.4, PHP8.2, and PHP8.3. I will not make a pull request because the changes may be different from the administrator's intentions. However, I would appreciate it if there were any points that could be helpful. Thank you for publishing the interesting source code.

kaguy4 commented 9 months ago

Thank you for the update. I would like to merge this, but I am having some issues, especially with images. Upgrading from a previous version, images now seem to link to https://website.com/board//1694371055943.png instead of proper https://website.com/board/src/1694371055943.png (where they actually are). So "src" is missing for some reason. Posting with an image fails too.

I will share error.log file of the board. I am not a PHP developer myself, so I don't know which parts are relevant. So I will post all just in case. "/home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh" is the root directory here.

When I open a thread, it writes the following lines to error.log

2023-09-17T22:35:11+02:00 ERROR Global - Error caught: #2: Use of undefined constant THUMB_SETTING - assumed 'THUMB_SETTING' (this will throw an Error in a future version of PHP) in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/lib/lib_pms.php on line 60
2023-09-17T22:35:11+02:00 ERROR Global - Error caught: #2: Illegal string offset 'Format' in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/lib/lib_pms.php on line 60

When I make a text-only post the post goes through, but it writes the following lines to error.log

2023-09-17T22:52:18+02:00 ERROR Global - Error caught: #2: Use of undefined constant THUMB_SETTING - assumed 'THUMB_SETTING' (this will throw an Error in a future version of PHP) in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/lib/lib_pms.php on line 60
2023-09-17T22:52:18+02:00 ERROR Global - Error caught: #2: Illegal string offset 'Format' in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/lib/lib_pms.php on line 60
2023-09-17T22:52:18+02:00 ERROR Global - Error caught: #2: Use of undefined constant ACTION_LOG - assumed 'ACTION_LOG' (this will throw an Error in a future version of PHP) in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/lib/lib_common.php on line 485

When I make a post with an image, it gives me blank screen. The post seemingly goes through, with the image not displaying anywhere. The board does not rebuild. It writes the following lines to error.log

2023-09-17T22:53:23+02:00 ERROR Global - Error caught: #2: Use of undefined constant THUMB_SETTING - assumed 'THUMB_SETTING' (this will throw an Error in a future version of PHP) in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/lib/lib_pms.php on line 60
2023-09-17T22:53:23+02:00 ERROR Global - Error caught: #2: Illegal string offset 'Format' in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/lib/lib_pms.php on line 60
2023-09-17T22:53:23+02:00 ERROR Global - Error caught: #2: Use of undefined constant ACTION_LOG - assumed 'ACTION_LOG' (this will throw an Error in a future version of PHP) in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/lib/lib_common.php on line 485
2023-09-17T22:53:23+02:00 ERROR Global - Error caught: #2: Use of undefined constant THUMB_SETTING - assumed 'THUMB_SETTING' (this will throw an Error in a future version of PHP) in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/koko.php on line 828
2023-09-17T22:53:23+02:00 ERROR Global - Error caught: #2: Illegal string offset 'Format' in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/koko.php on line 828
2023-09-17T22:53:23+02:00 ERROR Global - Error caught: #2: Use of undefined constant THUMB_SETTING - assumed 'THUMB_SETTING' (this will throw an Error in a future version of PHP) in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/koko.php on line 834
2023-09-17T22:53:23+02:00 ERROR Global - Error caught: #2: Illegal string offset 'Method' in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/koko.php on line 834
2023-09-17T22:53:23+02:00 ERROR Global - Error caught: #2: require(/home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/lib/thumb/thumb.T.php): failed to open stream: No such file or directory in /home/heyuri/web/dev/kokonotsuba1.4/kokonotsubagh/koko.php on line 835
satopian commented 9 months ago

I've made a lot of changes all at once, so I'll revert back and make smaller changes, then submit a pull request. It's working in my test environment, so I don't know what's causing it.

satopian commented 9 months ago

https://github.com/satopian/kokonotsuba_custom I moved the version that worked in my test environment PHP7.2-PHP8.3 here, restored the forked kokonotsuba, and made a pull request for the minor changes.

kaguy4 commented 9 months ago

I think I figured out what was the issue from earlier (I am not very sure what was causing it, but it seems to be an issue on my end - not with your code.), so there is no need to revert back to only make smaller changes now.

If it's okay with you, you can make the changes again to your fork, and I will merge them all.

kaguy4 commented 9 months ago

You can add them all to the existing Pull request too

satopian commented 9 months ago

https://github.com/Heyuri/kokonotsuba/pull/63 Last time I fixed undefined constants and undefined variables, but all I could do was predict the correct default value. This time we made changes by removing uncertain predictions, so incorrect behavior is less likely than before. Although the error still occurs, it now works in PHP8.3, so I would like to break it up here. Please let me know if this works correctly.

kaguy4 commented 9 months ago

Everything seem to work fine now, I merged it. Thanks again! ヽ(´ー`)ノ