diff --git a/src/wp-admin/includes/class-wp-filesystem-base.php b/src/wp-admin/includes/class-wp-filesystem-base.php
index c518408..090edec 100644
|
a
|
b
|
class WP_Filesystem_Base { |
| 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 | * |
diff --git a/src/wp-admin/includes/class-wp-filesystem-direct.php b/src/wp-admin/includes/class-wp-filesystem-direct.php
index f7d6cb1..051bb2a 100644
|
a
|
b
|
class WP_Filesystem_Direct extends WP_Filesystem_Base { |
| 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 ) ) { |
| … |
… |
class WP_Filesystem_Direct extends WP_Filesystem_Base { |
| 313 | 313 | |
| 314 | 314 | return $retval; |
| 315 | 315 | } |
| | 316 | |
| 316 | 317 | /** |
| 317 | 318 | * @param string $file |
| 318 | 319 | * @return bool |
| … |
… |
class WP_Filesystem_Direct extends WP_Filesystem_Base { |
| 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 |
| … |
… |
class WP_Filesystem_Direct extends WP_Filesystem_Base { |
| 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 |
| … |
… |
class WP_Filesystem_Direct extends WP_Filesystem_Base { |
| 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 | */ |
diff --git a/src/wp-admin/includes/class-wp-filesystem-ftpext.php b/src/wp-admin/includes/class-wp-filesystem-ftpext.php
index 36648e1..befd785 100644
|
a
|
b
|
class WP_Filesystem_FTPext extends WP_Filesystem_Base { |
| 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 | */ |
diff --git a/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
index 45f1235..4cf9f1d 100644
|
a
|
b
|
class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { |
| 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 | */ |
diff --git a/src/wp-admin/includes/class-wp-filesystem-ssh2.php b/src/wp-admin/includes/class-wp-filesystem-ssh2.php
index 82101be..af9752e 100644
|
a
|
b
|
class WP_Filesystem_SSH2 extends WP_Filesystem_Base { |
| 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 ) { |
| … |
… |
class WP_Filesystem_SSH2 extends WP_Filesystem_Base { |
| 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 | */ |
diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php
index d8433b4..4a4cc58 100644
|
a
|
b
|
class WP_Upgrader { |
| 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 ) ) { |