| 776 | | if ( ! $method && function_exists('getmyuid') && function_exists('fileowner') ){ |
| 777 | | if ( !$context ) |
| 778 | | $context = WP_CONTENT_DIR; |
| 779 | | $context = trailingslashit($context); |
| 780 | | $temp_file_name = $context . 'temp-write-test-' . time(); |
| 781 | | $temp_handle = @fopen($temp_file_name, 'w'); |
| 782 | | if ( $temp_handle ) { |
| 783 | | if ( getmyuid() == @fileowner($temp_file_name) ) |
| 784 | | $method = 'direct'; |
| 785 | | @fclose($temp_handle); |
| 786 | | @unlink($temp_file_name); |
| | 776 | if ( !$context ) |
| | 777 | $context = WP_CONTENT_DIR; |
| | 778 | |
| | 779 | if ( ! $method && function_exists('fileowner') && is_writable($context) ) { |
| | 780 | $owner = @fileowner(__FILE__); |
| | 781 | if ( false !== $owner ) { |
| | 782 | $context = trailingslashit($context); |
| | 783 | $temp_file_name = $context . 'temp-write-test-' . time(); |
| | 784 | $temp_handle = @fopen($temp_file_name, 'w'); |
| | 785 | if ( $temp_handle ) { |
| | 786 | $php_owner = @fileowner($temp_file_name); |
| | 787 | if ( $php_owner === $owner ) // Success |
| | 788 | $method = 'direct'; |
| | 789 | @fclose($temp_handle); |
| | 790 | @unlink($temp_file_name); |
| | 791 | } |