[wp-trac] [WordPress Trac] #41030: ssh2 FS_METHOD will not work with various php versions

WordPress Trac noreply at wordpress.org
Tue Jun 13 14:34:56 UTC 2017


#41030: ssh2 FS_METHOD will not work with various php versions
----------------------------+-----------------------------
 Reporter:  kynks           |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Filesystem API  |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 Due to this PHP bug - https://bugs.php.net/bug.php?id=73597

 ssh2 as FS_METHOD will not work with various version of PHP.

 Namely, WP_Filesystem_SSH2::is_dir() will always return false. The
 workaround suggested on the above PHP ticket should resolve the issue -
 using the intval() function in WP_Filesystem_SSH2::sftp_path() should
 resolve the issue, although I haven't tested this across a tonne of php
 versions.

 eg:

 {{{#!php
 <?php
 public function sftp_path( $path ) {
                 if ( '/' === $path ) {
                         $path = '/./';
                 }
                 return 'ssh2.sftp://' . intval($this->sftp_link) . '/' .
 ltrim( $path, '/' );
         }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41030>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list