Skip to content

Fix Uncaught exception Error with message 'Call to undefined function…#1

Merged
deepakrohillas merged 1 commit into
trunkfrom
deepakrohillas-patch-hello_dolly_uncaught_exception
May 15, 2024
Merged

Fix Uncaught exception Error with message 'Call to undefined function…#1
deepakrohillas merged 1 commit into
trunkfrom
deepakrohillas-patch-hello_dolly_uncaught_exception

Conversation

@deepakrohillas

Copy link
Copy Markdown
Owner

Trac ticket: https://core.trac.wordpress.org/ticket/61214


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

… add_action()

`error.message` LIKE 'Uncaught exception 'Error' with message 'Call to undefined function add_action()' in /var/www/wp-content/plugins/hello.php:69%' AND `error.class` = 'Error' AND transactionUiName = '/wp-content/plugins/hello.php'

'request_uri': '/wp-content/plugins/hello.php'
@deepakrohillas deepakrohillas merged commit 8332cbf into trunk May 15, 2024
@deepakrohillas deepakrohillas deleted the deepakrohillas-patch-hello_dolly_uncaught_exception branch June 23, 2024 11:07
felixarntz pushed a commit that referenced this pull request Aug 9, 2024
…Info screen.

This resolves a fatal error if `strict_types` PHP setting is enabled:
{{{
Argument #1 ($num) must be of type float, string given
}}}

Since the goal of the Site Health Info screen is to display raw values where possible, the `number_format()` call here does not seem to provide any benefit.

Props krishneup, sabernhardt, audrasjb, SergeyBiryukov.
Fixes #60364.

git-svn-id: https://develop.svn.wordpress.org/trunk@58847 602fd350-edb4-49c9-b593-d223f7449a82
deepakrohillas pushed a commit that referenced this pull request Oct 29, 2024
…ord()`.

This resolves a "passing null to non-nullable" deprecation notice on PHP 8.1+:
{{{
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated
}}}

Follow-up to [50129], [54477].

Props afragen, peterwilsoncc, SergeyBiryukov.
Fixes #62298.

git-svn-id: https://develop.svn.wordpress.org/trunk@59312 602fd350-edb4-49c9-b593-d223f7449a82
deepakrohillas pushed a commit that referenced this pull request Apr 19, 2026
…om `previous_posts()`.

The `esc_url()` function expects to a string for `$url` parameter. There is no input validation within that function. The function contains a `ltrim()` which also expects a string. Passing `null` to this parameter results in `Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated` notice on PHP 8.1+.

Tracing the stack back, a `null` is being passed to it within `previous_posts()` when `get_previous_posts_page_link()` returns `null` (it can return a string or `null`).

On PHP 7.0 to PHP 8.x, an empty string is returned from `esc_url()` when `null` is passed to it. The change in this changeset avoids the deprecation notice by not invoking `esc_url()` when `get_previous_posts_page_link()` returns `null` and instead sets the `$output` to an empty string, thus maintaining the same behavior as before (minus the deprecation notice).

Adds a test to validate an empty string is returned and the absence of the deprecation (when running on PHP 8.1+).

Follow-up to [9632], [11383], [56740].

Props dd32, alexodiy.
Fixes #64864.

git-svn-id: https://develop.svn.wordpress.org/trunk@62034 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant