From 2c25a1a0caf04d7add297a2ce104cae70a50fac2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 17 Oct 2020 16:34:45 +0000 Subject: [PATCH] Revisions: Explicitly declare the `Text_Diff::_getTempDir()` method as `static`. This fixes a "Non-static method cannot be called statically" fatal error on PHP 8. Props jrf. Fixes #51559. git-svn-id: https://develop.svn.wordpress.org/trunk@49185 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/Text/Diff.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/wp-includes/Text/Diff.php b/src/wp-includes/Text/Diff.php index f9452f2600..ab1c9a26dd 100644 --- a/src/wp-includes/Text/Diff.php +++ b/src/wp-includes/Text/Diff.php @@ -220,14 +220,12 @@ class Text_Diff { /** * Determines the location of the system temporary directory. * - * @static - * * @access protected * * @return string A directory name which can be used for temp files. * Returns false if one could not be found. */ - function _getTempDir() + static function _getTempDir() { $tmp_locations = array('/tmp', '/var/tmp', 'c:\WUTemp', 'c:\temp', 'c:\windows\temp', 'c:\winnt\temp');