Ticket #34684: 34684.patch
File 34684.patch, 2.7 KB (added by , 9 years ago) |
---|
-
wp-admin/includes/class-wp-filesystem-ssh2.php
114 114 } 115 115 116 116 if ( ! $this->link ) { 117 $this->errors->add('connect', sprintf(__('Failed to connect to SSH2 Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); 117 $this->errors->add( 'connect', 118 sprintf( 119 /* translators: 1: hostname 2: port */ 120 __( 'Failed to connect to SSH2 Server %1$s:%2$s' ), 121 $this->options['hostname'], 122 $this->options['port'] 123 ) 124 ); 118 125 return false; 119 126 } 120 127 121 128 if ( !$this->keys ) { 122 129 if ( ! @ssh2_auth_password($this->link, $this->options['username'], $this->options['password']) ) { 123 $this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username'])); 130 $this->errors->add( 'auth', 131 sprintf( 132 /* translators: %s: user name */ 133 __( 'Username/Password incorrect for %s' ), 134 $this->options['username'] 135 ) 136 ); 124 137 return false; 125 138 } 126 139 } else { 127 140 if ( ! @ssh2_auth_pubkey_file($this->link, $this->options['username'], $this->options['public_key'], $this->options['private_key'], $this->options['password'] ) ) { 128 $this->errors->add('auth', sprintf(__('Public and Private keys incorrect for %s'), $this->options['username'])); 141 $this->errors->add( 'auth', 142 sprintf( 143 /* translators: %s: user name */ 144 __( 'Public and Private keys incorrect for %s' ), 145 $this->options['username'] 146 ) 147 ); 129 148 return false; 130 149 } 131 150 } … … 132 151 133 152 $this->sftp_link = ssh2_sftp( $this->link ); 134 153 if ( ! $this->sftp_link ) { 135 $this->errors->add( 'connect', sprintf( __( 'Failed to initialize a SFTP subsystem session with the SSH2 Server %1$s:%2$s' ), $this->options['hostname'], $this->options['port'] ) ); 154 $this->errors->add( 'connect', 155 sprintf( 156 /* translators: 1: hostname 2: port */ 157 __( 'Failed to initialize a SFTP subsystem session with the SSH2 Server %1$s:%2$s' ), 158 $this->options['hostname'], 159 $this->options['port'] 160 ) 161 ); 136 162 return false; 137 163 } 138 164 … … 173 199 return false; 174 200 175 201 if ( ! ($stream = ssh2_exec($this->link, $command)) ) { 176 $this->errors->add('command', sprintf(__('Unable to perform command: %s'), $command)); 202 $this->errors->add( 'command', 203 sprintf( 204 /* translators: %s: command */ 205 __( 'Unable to perform command: %s'), 206 $command 207 ) 208 ); 177 209 } else { 178 210 stream_set_blocking( $stream, true ); 179 211 stream_set_timeout( $stream, FS_TIMEOUT );