Ticket #18744: functions.diff

File functions.diff, 625 bytes (added by denzel_chia, 20 months ago)
Line 
1Index: functions.php
2===================================================================
3--- functions.php       (revision 18750)
4+++ functions.php       (working copy)
5@@ -4398,6 +4398,14 @@
6  * @param string $context If specified adds filter hook "extra_{$context}_headers"
7  */
8 function get_file_data( $file, $default_headers, $context = '' ) {
9+
10+       //check if web host enabled allow_url_fopen
11+       $php_ini = ini_get('allow_url_fopen');
12+       if($php_ini == '' || $php_ini == 0){
13+          $file_data = array();
14+          return $file_data;
15+       }
16+
17        // We don't need to write to the file, so just open for reading.
18        $fp = fopen( $file, 'r' );
19