Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- /var/www/xxx/wp-admin/includes/class-wp-filesystem-ftpext.php.bak 2024-04-22 12:52:45.137057835 +0200
- +++ /var/www/xxx/wp-admin/includes/class-wp-filesystem-ftpext.php 2024-10-17 16:31:32.583056600 +0200
- @@ -135,6 +135,7 @@
- * or if the file couldn't be retrieved.
- */
- public function get_contents( $file ) {
- + if ( ! $this->link ) { return false; } // PHP 8.1 fix
- $tempfile = wp_tempnam( $file );
- $temphandle = fopen( $tempfile, 'w+' );
- @@ -227,6 +228,7 @@
- * @return string|false The current working directory on success, false on failure.
- */
- public function cwd() {
- + if ( ! $this->link ) { return false; } // PHP 8.1 fix
- $cwd = ftp_pwd( $this->link );
- if ( $cwd ) {
- @@ -425,6 +427,7 @@
- * @return bool Whether $path exists or not.
- */
- public function exists( $path ) {
- + if ( ! $this->link ) { return false; } // PHP 8.1 fix
- /*
- * Check for empty path. If ftp_nlist() receives an empty path,
- * it checks the current working directory and may return true.
- @@ -465,6 +468,7 @@
- * @return bool Whether $path is a directory.
- */
- public function is_dir( $path ) {
- + if ( ! $this->link ) { return false; } // PHP 8.1 fix
- $cwd = $this->cwd();
- $result = @ftp_chdir( $this->link, trailingslashit( $path ) );
- @@ -754,6 +758,7 @@
- * }
- */
- public function dirlist( $path = '.', $include_hidden = true, $recursive = false ) {
- + if ( ! $this->link ) { return false; } // PHP 8.1 fix
- if ( $this->is_file( $path ) ) {
- $limit_file = basename( $path );
- $path = dirname( $path ) . '/';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement