Ticket #46040: 46040.patch
| File 46040.patch, 4.7 KB (added by , 7 years ago) |
|---|
-
src/wp-admin/includes/class-wp-filesystem-base.php
668 668 return false; 669 669 } 670 670 671 /** 672 * Is the path a symbolic link. 673 * 674 * @param string $path File path. 675 * @return bool Whether $path is a symbolic link. 676 */ 677 public function is_link( $path ) { 678 return false; 679 } 680 671 681 /** 672 682 * Check if a file is readable. 673 683 * -
src/wp-admin/includes/class-wp-filesystem-direct.php
287 287 } 288 288 $file = str_replace( '\\', '/', $file ); // for win32, occasional problems deleting files otherwise 289 289 290 if ( 'f' == $type || $this->is_file( $file ) ) {290 if ( 'f' == $type || $this->is_file( $file ) || 'l' === $type || $this->is_link( $file ) ) { 291 291 return @unlink( $file ); 292 292 } 293 293 if ( ! $recursive && $this->is_dir( $file ) ) { … … 313 313 314 314 return $retval; 315 315 } 316 316 317 /** 317 318 * @param string $file 318 319 * @return bool … … 320 321 public function exists( $file ) { 321 322 return @file_exists( $file ); 322 323 } 324 323 325 /** 324 326 * @param string $file 325 327 * @return bool … … 327 329 public function is_file( $file ) { 328 330 return @is_file( $file ); 329 331 } 332 330 333 /** 331 334 * @param string $path 332 335 * @return bool … … 336 339 } 337 340 338 341 /** 342 * Is the path a symbolic link. 343 * 344 * @param string $path File path. 345 * @return bool Whether $path is a symbolic link. 346 */ 347 public function is_link( $path ) { 348 return @is_link( $path ); 349 } 350 351 352 /** 339 353 * @param string $file 340 354 * @return bool 341 355 */ -
src/wp-admin/includes/class-wp-filesystem-ftpext.php
361 361 } 362 362 363 363 /** 364 * Is the path a symbolic link. 365 * 366 * @param string $path File path. 367 * @return bool Whether $path is a symbolic link. 368 */ 369 public function is_link( $path ) { 370 return false; 371 } 372 373 /** 364 374 * @param string $file 365 375 * @return bool 366 376 */ -
src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
372 372 } 373 373 374 374 /** 375 * Is the path a symbolic link. 376 * 377 * @param string $path File path. 378 * @return bool Whether $path is a symbolic link. 379 */ 380 public function is_link( $path ) { 381 return false; 382 } 383 384 /** 375 385 * @param string $file 376 386 * @return bool 377 387 */ -
src/wp-admin/includes/class-wp-filesystem-ssh2.php
417 417 * @return bool 418 418 */ 419 419 public function delete( $file, $recursive = false, $type = false ) { 420 if ( 'f' == $type || $this->is_file( $file ) ) {420 if ( 'f' == $type || $this->is_file( $file ) || 'l' === $type || $this->is_link( $file ) ) { 421 421 return ssh2_sftp_unlink( $this->sftp_link, $file ); 422 422 } 423 423 if ( ! $recursive ) { … … 457 457 } 458 458 459 459 /** 460 * Is the path a symbolic link. 461 * 462 * @param string $path File path. 463 * @return bool Whether $path is a symbolic link. 464 */ 465 public function is_link( $path ) { 466 return is_link( $this->sftp_path( $path ) ); 467 } 468 469 /** 460 470 * @param string $file 461 471 * @return bool 462 472 */ -
src/wp-admin/includes/class-wp-upgrader.php
394 394 395 395 // Check writability. 396 396 foreach ( $files as $filename => $file_details ) { 397 if ( ! $wp_filesystem->is_writable( $remote_destination . $filename ) ) {397 if ( ! $wp_filesystem->is_writable( $remote_destination . $filename ) && ! $wp_filesystem->is_link( $remote_destination . $filename ) ) { 398 398 // Attempt to alter permissions to allow writes and try again. 399 399 $wp_filesystem->chmod( $remote_destination . $filename, ( 'd' == $file_details['type'] ? FS_CHMOD_DIR : FS_CHMOD_FILE ) ); 400 400 if ( ! $wp_filesystem->is_writable( $remote_destination . $filename ) ) {