#57659 closed defect (bug) (fixed)
Check the function set_time_limit() exist before calling
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Keywords: | has-patch | |
Focuses: | Cc: |
Description
The function set_time_limit() is used in multiple places in /wp-includes/class-pop3.php without check the function exist.
This throws a fatal error on certain environments.
Change History (7)
This ticket was mentioned in PR #4027 on WordPress/wordpress-develop by mujuonly.
2 years ago
#1
- Keywords has-patch added
#2
@
2 years ago
Hi there, welcome back to WordPress Trac! Thanks for the ticket.
I considered including this change in [55258] / #55711. Technically, class-pop3.php
is an "adopted" library with some changes over the years, mostly PHP compatibility adjustments and typo fixes.
Since it's not actively supported and it was not immediately clear to me whether this code is ever executed in core, I chose not to include this file in [55258] at the time, though I don't have any objections to making this change. Curious to see what others think :)
#3
@
2 years ago
The file is included in /wp-mail.php #L32
/** Get the POP3 class with which to access the mailbox. */ require_once ABSPATH . WPINC . '/class-pop3.php';
#4
@
2 years ago
- Component changed from General to Mail
- Milestone changed from Awaiting Review to 6.2
Yeah, it appears to be used for the "Post via email" functionality.
On second thought, I don't see any downsides to adding a check for set_time_limit()
in this file too, so might as well do it for consistency with the rest of core.
Minor nitpick: since the file does not follow WordPress coding standards, it would be more internally consistent here to use double quotes and avoid spaces between brackets. This can be adjusted on commit.
#5
@
2 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 55305:
@SergeyBiryukov commented on PR #4027:
2 years ago
#6
Thanks for the PR! Merged in r55305.
This avoids a fatal error if the function is disabled on certain environments. This can be handled like
( strpos(ini_get('disable_functions'), 'set_time_limit') === false )
as well.This avoids a fatal error if the function is disabled on certain environments. This can be handled like
( strpos(ini_get('disable_functions'), 'set_time_limit') === false )
as well.Trac ticket: https://core.trac.wordpress.org/ticket/57659