"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/inc/functions.php" between
mybb_1821.zip and mybb_1822.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

functions.php  (mybb_1821):functions.php  (mybb_1822)
skipping to change at line 6564 skipping to change at line 6564
$query = $db->simple_select("settings", "value, name", "", array( $query = $db->simple_select("settings", "value, name", "", array(
'order_by' => 'title', 'order_by' => 'title',
'order_dir' => 'ASC', 'order_dir' => 'ASC',
)); ));
$settings = ''; $settings = '';
while($setting = $db->fetch_array($query)) while($setting = $db->fetch_array($query))
{ {
$mybb->settings[$setting['name']] = $setting['value']; $mybb->settings[$setting['name']] = $setting['value'];
$setting['name'] = addcslashes($setting['name'], "\\'");
$setting['value'] = addcslashes($setting['value'], '\\"$'); $setting['value'] = addcslashes($setting['value'], '\\"$');
$settings .= "\$settings['{$setting['name']}'] = \"{$setting['val ue']}\";\n"; $settings .= "\$settings['{$setting['name']}'] = \"{$setting['val ue']}\";\n";
} }
$settings = "<"."?php\n/*********************************\ \n DO NOT EDI T THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\******************************* **/\n\n$settings\n"; $settings = "<"."?php\n/*********************************\ \n DO NOT EDI T THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\******************************* **/\n\n$settings\n";
file_put_contents(MYBB_ROOT.'inc/settings.php', $settings, LOCK_EX); file_put_contents(MYBB_ROOT.'inc/settings.php', $settings, LOCK_EX);
$GLOBALS['settings'] = &$mybb->settings; $GLOBALS['settings'] = &$mybb->settings;
} }
skipping to change at line 7115 skipping to change at line 7117
$response = curl_exec($ch); $response = curl_exec($ch);
if($fetch_header) if($fetch_header)
{ {
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$header = substr($response, 0, $header_size); $header = substr($response, 0, $header_size);
$body = substr($response, $header_size); $body = substr($response, $header_size);
if(in_array(curl_getinfo($ch, CURLINFO_HTTP_CODE), array( 301, 302))) if(in_array(curl_getinfo($ch, CURLINFO_HTTP_CODE), array( 301, 302)))
{ {
preg_match('/Location:(.*?)(?:\n|$)/', $header, $ matches); preg_match('/^Location:(.*?)(?:\n|$)/im', $header , $matches);
if($matches) if($matches)
{ {
$data = fetch_remote_file(trim(array_pop( $matches)), $post_data, --$max_redirects); $data = fetch_remote_file(trim(array_pop( $matches)), $post_data, --$max_redirects);
} }
} }
else else
{ {
$data = $body; $data = $body;
} }
skipping to change at line 7240 skipping to change at line 7242
fclose($fp); fclose($fp);
$data = explode("\r\n\r\n", $data, 2); $data = explode("\r\n\r\n", $data, 2);
$header = $data[0]; $header = $data[0];
$status_line = current(explode("\n\n", $header, 1)); $status_line = current(explode("\n\n", $header, 1));
$body = $data[1]; $body = $data[1];
if($max_redirects > 0 && (strstr($status_line, ' 301 ') || strstr ($status_line, ' 302 '))) if($max_redirects > 0 && (strstr($status_line, ' 301 ') || strstr ($status_line, ' 302 ')))
{ {
preg_match('/Location:(.*?)(?:\n|$)/', $header, $matches) ; preg_match('/^Location:(.*?)(?:\n|$)/im', $header, $match es);
if($matches) if($matches)
{ {
$data = fetch_remote_file(trim(array_pop($matches )), $post_data, --$max_redirects); $data = fetch_remote_file(trim(array_pop($matches )), $post_data, --$max_redirects);
} }
} }
else else
{ {
$data = $body; $data = $body;
} }
 End of changes. 3 change blocks. 
2 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)