MyBB Community Forums

Full Version: My Advertisements plugin PHP 7.4 warnings
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there! I just upgrade my hosting PHP version to 7.4 and found many warnings related to My Advertisements plugin.

His website is down and I don't know where I can contact him. Any idea of how can it be fixed? Thank you all!

The warnigs are these:

Warning [2] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - Line: 616 - File: inc/plugins/myadvertisements.php PHP 7.4.13 (Linux)
File	Line	Function
/inc/class_plugins.php	38	errorHandler->error
/inc/class_plugins.php	38	require_once
/inc/init.php	239	pluginSystem->load
/admin/index.php	18	require_once
Warning [2] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - Line: 657 - File: inc/plugins/myadvertisements.php PHP 7.4.13 (Linux)
File	Line	Function
/inc/class_plugins.php	38	errorHandler->error
/inc/class_plugins.php	38	require_once
/inc/init.php	239	pluginSystem->load
/admin/index.php	18	require_once
Warning [2] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - Line: 704 - File: inc/plugins/myadvertisements.php PHP 7.4.13 (Linux)
File	Line	Function
/inc/class_plugins.php	38	errorHandler->error
/inc/class_plugins.php	38	require_once
/inc/init.php	239	pluginSystem->load
/admin/index.php	18	require_once
Warning [2] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - Line: 752 - File: inc/plugins/myadvertisements.php PHP 7.4.13 (Linux)
File	Line	Function
/inc/class_plugins.php	38	errorHandler->error
/inc/class_plugins.php	38	require_once
/inc/init.php	239	pluginSystem->load
/admin/index.php	18	require_once
Warning [2] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - Line: 804 - File: inc/plugins/myadvertisements.php PHP 7.4.13 (Linux)
File	Line	Function
/inc/class_plugins.php	38	errorHandler->error
/inc/class_plugins.php	38	require_once
/inc/init.php	239	pluginSystem->load
/admin/index.php	18	require_once
Warning [2] Cannot modify header information - headers already sent by (output started at /homepages/19/d308843411/htdocs/mybb/inc/class_error.php:229) - Line: 4829 - File: inc/functions.php PHP 7.4.13 (Linux)
File	Line	Function
[PHP]		errorHandler->error
/inc/functions.php	4829	header
/admin/index.php	22	send_page_headers
Warning [2] Cannot modify header information - headers already sent by (output started at /homepages/19/d308843411/htdocs/mybb/inc/class_error.php:229) - Line: 24 - File: admin/index.php PHP 7.4.13 (Linux)
File	Line	Function
[PHP]		errorHandler->error
/admin/index.php	24	header
Warning [2] Cannot modify header information - headers already sent by (output started at /homepages/19/d308843411/htdocs/mybb/inc/class_error.php:229) - Line: 25 - File: admin/index.php PHP 7.4.13 (Linux)
File	Line	Function
[PHP]		errorHandler->error
/admin/index.php	25	header
Warning [2] Cannot modify header information - headers already sent by (output started at /homepages/19/d308843411/htdocs/mybb/inc/class_error.php:229) - Line: 64 - File: admin/index.php PHP 7.4.13 (Linux)
File	Line	Function
[PHP]		errorHandler->error
/admin/index.php	64	header
Fixed: replace all "continue" with "break" in myadvertisements.php
(2020-12-03, 04:47 PM)undasein Wrote: [ -> ]Fixed: replace all "continue" with "break" in myadvertisements.php

I just switched from php7.2 to php7.4.29 and had the same issue.

I replaced "continue" with "break" and now everything is working fine.
Thank you very much.

Note:
Do I have to deactivate and reactivate the plugin or is that enough?
Sorry, I'm no longer using this plugin, but you should be ok