Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

WP-r56622: Add sys_get_temp_dir() to open_basedir tests #218

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/phpunit/tests/admin/wpAutomaticUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ public function test_is_allowed_dir_should_return_true_if_open_basedir_is_set_an

$open_basedir_backup = ini_get( 'open_basedir' );
// Allow access to the directory one level above the repository.
ini_set( 'open_basedir', wp_normalize_path( $abspath_grandparent ) );
ini_set( 'open_basedir', sys_get_temp_dir() . PATH_SEPARATOR . wp_normalize_path( $abspath_grandparent ) );

// Checking an allowed directory should succeed.
$actual = self::$updater->is_allowed_dir( wp_normalize_path( ABSPATH ) );
Expand Down Expand Up @@ -645,7 +645,7 @@ public function test_is_allowed_dir_should_return_false_if_open_basedir_is_set_a

$open_basedir_backup = ini_get( 'open_basedir' );
// Allow access to the directory one level above the repository.
ini_set( 'open_basedir', wp_normalize_path( $abspath_grandparent ) );
ini_set( 'open_basedir', sys_get_temp_dir() . PATH_SEPARATOR . wp_normalize_path( $abspath_grandparent ) );

// Checking a directory not within the allowed path should trigger an `open_basedir` warning.
$actual = self::$updater->is_allowed_dir( '/.git' );
Expand Down