"Fossies" - the Fresh Open Source Software Archive  

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

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

functions.php  (mybb_1822):functions.php  (mybb_1823)
skipping to change at line 227 skipping to change at line 227
$plugins = new pluginSystem; $plugins = new pluginSystem;
$plugins->load(); $plugins->load();
} }
// We have some shutdown queries needing to be run // We have some shutdown queries needing to be run
if(is_array($shutdown_queries)) if(is_array($shutdown_queries))
{ {
// Loop through and run them all // Loop through and run them all
foreach($shutdown_queries as $query) foreach($shutdown_queries as $query)
{ {
$db->query($query); $db->write_query($query);
} }
} }
// Run any shutdown functions if we have them // Run any shutdown functions if we have them
if(is_array($shutdown_functions)) if(is_array($shutdown_functions))
{ {
foreach($shutdown_functions as $function) foreach($shutdown_functions as $function)
{ {
call_user_func_array($function['function'], $function['ar guments']); call_user_func_array($function['function'], $function['ar guments']);
} }
skipping to change at line 613 skipping to change at line 613
$mail->additional_parameters = $mybb->settings['mail_para meters']; $mail->additional_parameters = $mybb->settings['mail_para meters'];
} }
} }
// Build and send // Build and send
$mail->build_message($to, $subject, $message, $from, $charset, $headers, $format, $message_text, $return_email); $mail->build_message($to, $subject, $message, $from, $charset, $headers, $format, $message_text, $return_email);
return $mail->send(); return $mail->send();
} }
/** /**
* Generates a unique code for POST requests to prevent XSS/CSRF attacks * Generates a code for POST requests to prevent XSS/CSRF attacks.
* Unique for each user or guest session and rotated every 6 hours.
* *
* @param int $rotation_shift Adjustment of the rotation number to generate a pa st/future code
* @return string The generated code * @return string The generated code
*/ */
function generate_post_check() function generate_post_check($rotation_shift=0)
{ {
global $mybb, $session; global $mybb, $session;
$rotation_interval = 6 * 3600;
$rotation = floor(TIME_NOW / $rotation_interval) + $rotation_shift;
$seed = $rotation;
if($mybb->user['uid']) if($mybb->user['uid'])
{ {
return md5($mybb->user['loginkey'].$mybb->user['salt'].$mybb->use r['regdate']); $seed .= $mybb->user['loginkey'].$mybb->user['salt'].$mybb->user[ 'regdate'];
} }
// Guests get a special string
else else
{ {
return md5($session->sid.$mybb->config['database']['username'].$m ybb->settings['internal']['encryption_key']); $seed .= $session->sid;
} }
$seed .= $mybb->settings['internal']['encryption_key'];
return md5($seed);
} }
/** /**
* Verifies a POST check code is valid, if not shows an error (silently returns false on silent parameter) * Verifies a POST check code is valid (i.e. generated using a rotation number f rom the past 24 hours)
* *
* @param string $code The incoming POST check code * @param string $code The incoming POST check code
* @param boolean $silent Silent mode or not (silent mode will not show the erro * @param boolean $silent Don't show an error to the user
r to the user but returns false) * @return bool|void Result boolean if $silent is true, otherwise shows an error
* @return bool to the user
*/ */
function verify_post_check($code, $silent=false) function verify_post_check($code, $silent=false)
{ {
global $lang; global $lang;
if(generate_post_check() !== $code) if(
generate_post_check() !== $code &&
generate_post_check(-1) !== $code &&
generate_post_check(-2) !== $code &&
generate_post_check(-3) !== $code
)
{ {
if($silent == true) if($silent == true)
{ {
return false; return false;
} }
else else
{ {
if(defined("IN_ADMINCP")) if(defined("IN_ADMINCP"))
{ {
return false; return false;
skipping to change at line 779 skipping to change at line 795
} }
} }
} }
if(!is_array($forums_by_parent[$fid])) if(!is_array($forums_by_parent[$fid]))
{ {
return $forums; return $forums;
} }
foreach($forums_by_parent[$fid] as $forum) foreach($forums_by_parent[$fid] as $forum)
{ {
$forums[] = $forum['fid']; $forums[] = (int)$forum['fid'];
$children = get_child_list($forum['fid']); $children = get_child_list($forum['fid']);
if(is_array($children)) if(is_array($children))
{ {
$forums = array_merge($forums, $children); $forums = array_merge($forums, $children);
} }
} }
return $forums; return $forums;
} }
/** /**
skipping to change at line 1034 skipping to change at line 1050
* *
* @param int $count The number of items * @param int $count The number of items
* @param int $perpage The number of items to be shown per page * @param int $perpage The number of items to be shown per page
* @param int $page The current page number * @param int $page The current page number
* @param string $url The URL to have page numbers tacked on to (If {page} is sp ecified, the value will be replaced with the page #) * @param string $url The URL to have page numbers tacked on to (If {page} is sp ecified, the value will be replaced with the page #)
* @param boolean $breadcrumb Whether or not the multipage is being shown in the navigation breadcrumb * @param boolean $breadcrumb Whether or not the multipage is being shown in the navigation breadcrumb
* @return string The generated pagination * @return string The generated pagination
*/ */
function multipage($count, $perpage, $page, $url, $breadcrumb=false) function multipage($count, $perpage, $page, $url, $breadcrumb=false)
{ {
global $theme, $templates, $lang, $mybb; global $theme, $templates, $lang, $mybb, $plugins;
if($count <= $perpage) if($count <= $perpage)
{ {
return ''; return '';
} }
$args = array(
'count' => &$count,
'perpage' => &$perpage,
'page' => &$page,
'url' => &$url,
'breadcrumb' => &$breadcrumb,
);
$plugins->run_hooks('multipage', $args);
$page = (int)$page; $page = (int)$page;
$url = str_replace("&amp;", "&", $url); $url = str_replace("&amp;", "&", $url);
$url = htmlspecialchars_uni($url); $url = htmlspecialchars_uni($url);
$pages = ceil($count / $perpage); $pages = ceil($count / $perpage);
$prevpage = ''; $prevpage = '';
if($page > 1) if($page > 1)
{ {
skipping to change at line 1515 skipping to change at line 1540
} }
if(count($current_permissions) == 0) if(count($current_permissions) == 0)
{ {
$current_permissions = $groupperms; $current_permissions = $groupperms;
} }
return $current_permissions; return $current_permissions;
} }
/** /**
* Check whether password for given forum was validated for the current user
*
* @param array $forum The forum data
* @param bool $ignore_empty Whether to treat forum password configured as an em
pty string as validated
* @param bool $check_parents Whether to check parent forums using `parentlist`
* @return bool
*/
function forum_password_validated($forum, $ignore_empty=false, $check_parents=fa
lse)
{
global $mybb, $forum_cache;
if($check_parents && isset($forum['parentlist']))
{
if(!is_array($forum_cache))
{
$forum_cache = cache_forums();
if(!$forum_cache)
{
return false;
}
}
$parents = explode(',', $forum['parentlist']);
rsort($parents);
foreach($parents as $parent_id)
{
if($parent_id != $forum['fid'] && !forum_password_validat
ed($forum_cache[$parent_id], true))
{
return false;
}
}
}
return ($ignore_empty && $forum['password'] === '') || (
isset($mybb->cookies['forumpass'][$forum['fid']]) &&
my_hash_equals(
md5($mybb->user['uid'].$forum['password']),
$mybb->cookies['forumpass'][$forum['fid']]
)
);
}
/**
* Check the password given on a certain forum for validity * Check the password given on a certain forum for validity
* *
* @param int $fid The forum ID * @param int $fid The forum ID
* @param int $pid The Parent ID * @param int $pid The Parent ID
* @param bool $return * @param bool $return
* @return bool * @return bool
*/ */
function check_forum_password($fid, $pid=0, $return=false) function check_forum_password($fid, $pid=0, $return=false)
{ {
global $mybb, $header, $footer, $headerinclude, $theme, $templates, $lang , $forum_cache; global $mybb, $header, $footer, $headerinclude, $theme, $templates, $lang , $forum_cache;
skipping to change at line 1552 skipping to change at line 1621
} }
if(!empty($parents)) if(!empty($parents))
{ {
foreach($parents as $parent_id) foreach($parents as $parent_id)
{ {
if($parent_id == $fid || $parent_id == $pid) if($parent_id == $fid || $parent_id == $pid)
{ {
continue; continue;
} }
if($forum_cache[$parent_id]['password'] != "") if($forum_cache[$parent_id]['password'] !== "")
{ {
check_forum_password($parent_id, $fid); check_forum_password($parent_id, $fid);
} }
} }
} }
if(!empty($forum_cache[$fid]['password'])) if($forum_cache[$fid]['password'] !== '')
{ {
$password = $forum_cache[$fid]['password'];
if(isset($mybb->input['pwverify']) && $pid == 0) if(isset($mybb->input['pwverify']) && $pid == 0)
{ {
if($password === $mybb->get_input('pwverify')) if(my_hash_equals($forum_cache[$fid]['password'], $mybb-> get_input('pwverify')))
{ {
my_setcookie("forumpass[$fid]", md5($mybb->user[' uid'].$mybb->get_input('pwverify')), null, true); my_setcookie("forumpass[$fid]", md5($mybb->user[' uid'].$mybb->get_input('pwverify')), null, true);
$showform = false; $showform = false;
} }
else else
{ {
eval("\$pwnote = \"".$templates->get("forumdispla y_password_wrongpass")."\";"); eval("\$pwnote = \"".$templates->get("forumdispla y_password_wrongpass")."\";");
$showform = true; $showform = true;
} }
} }
else else
{ {
if(!$mybb->cookies['forumpass'][$fid] || ($mybb->cookies[ 'forumpass'][$fid] && md5($mybb->user['uid'].$password) !== $mybb->cookies['foru mpass'][$fid])) if(!forum_password_validated($forum_cache[$fid]))
{ {
$showform = true; $showform = true;
} }
else else
{ {
$showform = false; $showform = false;
} }
} }
} }
else else
skipping to change at line 1809 skipping to change at line 1877
else else
{ {
return false; return false;
} }
} }
} }
} }
} }
/** /**
* Get an array of fids that the forum moderator has access to.
* Do not use for administraotrs or global moderators as they moderate any forum
and the function will return false.
*
* @param int $uid The user ID (0 assumes current user)
* @return array|bool an array of the fids the user has moderator access to or b
ool if called incorrectly.
*/
function get_moderated_fids($uid=0)
{
global $mybb, $cache;
if($uid == 0)
{
$uid = $mybb->user['uid'];
}
if($uid == 0)
{
return array();
}
$user_perms = user_permissions($uid);
if($user_perms['issupermod'] == 1)
{
return false;
}
$fids = array();
$modcache = $cache->read('moderators');
if(!empty($modcache))
{
$groups = explode(',', $user_perms['all_usergroups']);
foreach($modcache as $fid => $forum)
{
if(isset($forum['users'][$uid]) && $forum['users'][$uid][
'mid'])
{
$fids[] = $fid;
continue;
}
foreach($groups as $group)
{
if(trim($group) != '' && isset($forum['usergroups
'][$group]))
{
$fids[] = $fid;
}
}
}
}
return $fids;
}
/**
* Generate a list of the posticons. * Generate a list of the posticons.
* *
* @return string The template of posticons. * @return string The template of posticons.
*/ */
function get_post_icons() function get_post_icons()
{ {
global $mybb, $cache, $icon, $theme, $templates, $lang; global $mybb, $cache, $icon, $theme, $templates, $lang;
if(isset($mybb->input['icon'])) if(isset($mybb->input['icon']))
{ {
skipping to change at line 4268 skipping to change at line 4392
if(!is_array($forum_cache)) if(!is_array($forum_cache))
{ {
cache_forums(); cache_forums();
} }
if(!is_array($permissioncache)) if(!is_array($permissioncache))
{ {
$permissioncache = forum_permissions(); $permissioncache = forum_permissions();
} }
$password_forums = $unviewable = array(); $unviewable = array();
foreach($forum_cache as $fid => $forum) foreach($forum_cache as $fid => $forum)
{ {
if($permissioncache[$forum['fid']]) if($permissioncache[$forum['fid']])
{ {
$perms = $permissioncache[$forum['fid']]; $perms = $permissioncache[$forum['fid']];
} }
else else
{ {
$perms = $mybb->usergroup; $perms = $mybb->usergroup;
} }
$pwverified = 1; $pwverified = 1;
if($forum['password'] != "") if(!forum_password_validated($forum, true))
{ {
if($mybb->cookies['forumpass'][$forum['fid']] !== md5($my $pwverified = 0;
bb->user['uid'].$forum['password']))
{
$pwverified = 0;
}
$password_forums[$forum['fid']] = $forum['password'];
} }
else else
{ {
// Check parents for passwords // Check parents for passwords
$parents = explode(",", $forum['parentlist']); $parents = explode(",", $forum['parentlist']);
foreach($parents as $parent) foreach($parents as $parent)
{ {
if(isset($password_forums[$parent]) && $mybb->coo kies['forumpass'][$parent] !== md5($mybb->user['uid'].$password_forums[$parent]) ) if(!forum_password_validated($forum_cache[$parent ], true))
{ {
$pwverified = 0; $pwverified = 0;
break;
} }
} }
} }
if($perms['canview'] == 0 || $pwverified == 0 || ($only_readable_ threads == true && $perms['canviewthreads'] == 0)) if($perms['canview'] == 0 || $pwverified == 0 || ($only_readable_ threads == true && $perms['canviewthreads'] == 0))
{ {
$unviewable[] = $forum['fid']; $unviewable[] = $forum['fid'];
} }
} }
skipping to change at line 4699 skipping to change at line 4819
/** /**
* Outputs the correct page headers. * Outputs the correct page headers.
*/ */
function send_page_headers() function send_page_headers()
{ {
global $mybb; global $mybb;
if($mybb->settings['nocacheheaders'] == 1) if($mybb->settings['nocacheheaders'] == 1)
{ {
header("Expires: Sat, 1 Jan 2000 01:00:00 GMT"); header("Cache-Control: no-cache, private");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
} }
} }
/** /**
* Mark specific reported posts of a certain type as dealt with * Mark specific reported posts of a certain type as dealt with
* *
* @param array|int $id An array or int of the ID numbers you're marking as deal t with * @param array|int $id An array or int of the ID numbers you're marking as deal t with
* @param string $type The type of item the above IDs are for - post, posts, thr ead, threads, forum, all * @param string $type The type of item the above IDs are for - post, posts, thr ead, threads, forum, all
*/ */
function mark_reports($id, $type="post") function mark_reports($id, $type="post")
skipping to change at line 5031 skipping to change at line 5148
* *
* @param int $uid The user ID * @param int $uid The user ID
* @param int $leavegroup The user group ID * @param int $leavegroup The user group ID
*/ */
function leave_usergroup($uid, $leavegroup) function leave_usergroup($uid, $leavegroup)
{ {
global $db, $mybb, $cache; global $db, $mybb, $cache;
$user = get_user($uid); $user = get_user($uid);
if($user['usergroup'] == $leavegroup)
{
return false;
}
$groupslist = $comma = ''; $groupslist = $comma = '';
$usergroups = $user['additionalgroups'].","; $usergroups = $user['additionalgroups'].",";
$donegroup = array(); $donegroup = array();
$groups = explode(",", $user['additionalgroups']); $groups = explode(",", $user['additionalgroups']);
if(is_array($groups)) if(is_array($groups))
{ {
foreach($groups as $gid) foreach($groups as $gid)
{ {
skipping to change at line 5069 skipping to change at line 5191
WHERE uid='".(int)$uid."' WHERE uid='".(int)$uid."'
"); ");
$cache->update_moderators(); $cache->update_moderators();
} }
/** /**
* Get the current location taking in to account different web serves and system s * Get the current location taking in to account different web serves and system s
* *
* @param boolean $fields True to return as "hidden" fields * @param boolean $fields True to return as "hidden" fields
* @param array $ignore Array of fields to ignore if first argument is true * @param array $ignore Array of fields to ignore for returning "hidden" fields or URL being accessed
* @param boolean $quick True to skip all inputs and return only the file path p art of the URL * @param boolean $quick True to skip all inputs and return only the file path p art of the URL
* @return string The current URL being accessed * @return string|array The current URL being accessed or form data if $fields i s true
*/ */
function get_current_location($fields=false, $ignore=array(), $quick=false) function get_current_location($fields=false, $ignore=array(), $quick=false)
{ {
global $mybb;
if(defined("MYBB_LOCATION")) if(defined("MYBB_LOCATION"))
{ {
return MYBB_LOCATION; return MYBB_LOCATION;
} }
if(!empty($_SERVER['SCRIPT_NAME'])) if(!empty($_SERVER['SCRIPT_NAME']))
{ {
$location = htmlspecialchars_uni($_SERVER['SCRIPT_NAME']); $location = htmlspecialchars_uni($_SERVER['SCRIPT_NAME']);
} }
elseif(!empty($_SERVER['PHP_SELF'])) elseif(!empty($_SERVER['PHP_SELF']))
skipping to change at line 5106 skipping to change at line 5230
else else
{ {
$location = htmlspecialchars_uni($_ENV['PATH_INFO']); $location = htmlspecialchars_uni($_ENV['PATH_INFO']);
} }
if($quick) if($quick)
{ {
return $location; return $location;
} }
if($fields == true) if(!is_array($ignore))
{ {
global $mybb; $ignore = array($ignore);
}
if(!is_array($ignore)) if($fields == true)
{ {
$ignore = array($ignore);
}
$form_html = ''; $form_html = '';
if(!empty($mybb->input)) if(!empty($mybb->input))
{ {
foreach($mybb->input as $name => $value) foreach($mybb->input as $name => $value)
{ {
if(in_array($name, $ignore) || is_array($name) || is_array($value)) if(in_array($name, $ignore) || is_array($name) || is_array($value))
{ {
continue; continue;
} }
$form_html .= "<input type=\"hidden\" name=\"".ht mlspecialchars_uni($name)."\" value=\"".htmlspecialchars_uni($value)."\" />\n"; $form_html .= "<input type=\"hidden\" name=\"".ht mlspecialchars_uni($name)."\" value=\"".htmlspecialchars_uni($value)."\" />\n";
} }
} }
return array('location' => $location, 'form_html' => $form_html, 'form_method' => $mybb->request_method); return array('location' => $location, 'form_html' => $form_html, 'form_method' => $mybb->request_method);
} }
else else
{ {
$parameters = array();
if(isset($_SERVER['QUERY_STRING'])) if(isset($_SERVER['QUERY_STRING']))
{ {
$location .= "?".htmlspecialchars_uni($_SERVER['QUERY_STR ING']); $current_query_string = $_SERVER['QUERY_STRING'];
} }
else if(isset($_ENV['QUERY_STRING'])) else if(isset($_ENV['QUERY_STRING']))
{ {
$location .= "?".htmlspecialchars_uni($_ENV['QUERY_STRING $current_query_string = $_ENV['QUERY_STRING'];
']); } else
{
$current_query_string = '';
} }
if((isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD parse_str($current_query_string, $current_parameters);
'] == "POST") || (isset($_ENV['REQUEST_METHOD']) && $_ENV['REQUEST_METHOD'] == "
POST")) foreach($current_parameters as $name => $value)
{
if(!in_array($name, $ignore))
{
$parameters[$name] = $value;
}
}
if($mybb->request_method === 'post')
{ {
$post_array = array('action', 'fid', 'pid', 'tid', 'uid', 'eid'); $post_array = array('action', 'fid', 'pid', 'tid', 'uid', 'eid');
foreach($post_array as $var) foreach($post_array as $var)
{ {
if(isset($_POST[$var])) if(isset($_POST[$var]) && !in_array($var, $ignore ))
{ {
$addloc[] = urlencode($var).'='.urlencode ($_POST[$var]); $parameters[$var] = $_POST[$var];
} }
} }
}
if(isset($addloc) && is_array($addloc)) if(!empty($parameters))
{ {
if(strpos($location, "?") === false) $location .= '?'.http_build_query($parameters, '', '&amp;
{ ');
$location .= "?";
}
else
{
$location .= "&amp;";
}
$location .= implode("&amp;", $addloc);
}
} }
return $location; return $location;
} }
} }
/** /**
* Build a theme selection menu * Build a theme selection menu
* *
* @param string $name The name of the menu * @param string $name The name of the menu
skipping to change at line 5802 skipping to change at line 5932
} }
else else
{ {
$string = strtolower($string); $string = strtolower($string);
} }
return $string; return $string;
} }
/** /**
* Finds a needle in a haystack and returns it position, mb strings accounted fo
r, case insensitive
*
* @param string $haystack String to look in (haystack)
* @param string $needle What to look for (needle)
* @param int $offset (optional) How much to offset
* @return int|bool false on needle not found, integer position if found
*/
function my_stripos($haystack, $needle, $offset=0)
{
if($needle == '')
{
return false;
}
if(function_exists("mb_stripos"))
{
$position = mb_stripos($haystack, $needle, $offset);
}
else
{
$position = stripos($haystack, $needle, $offset);
}
return $position;
}
/**
* Finds a needle in a haystack and returns it position, mb strings accounted fo r * Finds a needle in a haystack and returns it position, mb strings accounted fo r
* *
* @param string $haystack String to look in (haystack) * @param string $haystack String to look in (haystack)
* @param string $needle What to look for (needle) * @param string $needle What to look for (needle)
* @param int $offset (optional) How much to offset * @param int $offset (optional) How much to offset
* @return int|bool false on needle not found, integer position if found * @return int|bool false on needle not found, integer position if found
*/ */
function my_strpos($haystack, $needle, $offset=0) function my_strpos($haystack, $needle, $offset=0)
{ {
if($needle == '') if($needle == '')
skipping to change at line 6272 skipping to change at line 6429
* *
* @param int $fid The forum id of the forum. * @param int $fid The forum id of the forum.
* @param int $active_override (Optional) If set to 1, will override the active forum status * @param int $active_override (Optional) If set to 1, will override the active forum status
* @return array|bool The database row of a forum. False on failure * @return array|bool The database row of a forum. False on failure
*/ */
function get_forum($fid, $active_override=0) function get_forum($fid, $active_override=0)
{ {
global $cache; global $cache;
static $forum_cache; static $forum_cache;
if(!isset($forum_cache) || is_array($forum_cache)) if(!isset($forum_cache) || !is_array($forum_cache))
{ {
$forum_cache = $cache->read("forums"); $forum_cache = $cache->read("forums");
} }
if(empty($forum_cache[$fid])) if(empty($forum_cache[$fid]))
{ {
return false; return false;
} }
if($active_override != 1) if($active_override != 1)
skipping to change at line 7178 skipping to change at line 7335
'cafile' => $ca_bundle_path, 'cafile' => $ca_bundle_path,
), ),
)); ));
} }
else else
{ {
$context = stream_context_create(array( $context = stream_context_create(array(
'ssl' => array( 'ssl' => array(
'verify_peer' => false, 'verify_peer' => false,
'verify_peer_name' => false, 'verify_peer_name' => false,
'peer_name' => $url_components['h ost'],
), ),
)); ));
} }
$fp = @stream_socket_client($scheme.$destination_address. ':'.(int)$url_components['port'], $error_no, $error, 10, STREAM_CLIENT_CONNECT, $context); $fp = @stream_socket_client($scheme.$destination_address. ':'.(int)$url_components['port'], $error_no, $error, 10, STREAM_CLIENT_CONNECT, $context);
} }
else else
{ {
$fp = @fsockopen($scheme.$url_components['host'], (int)$u rl_components['port'], $error_no, $error, 10); $fp = @fsockopen($scheme.$url_components['host'], (int)$u rl_components['port'], $error_no, $error, 10);
} }
skipping to change at line 8743 skipping to change at line 8901
$real_file_path = realpath($file_path); $real_file_path = realpath($file_path);
$file_dir_path = dirname($real_file_path); $file_dir_path = dirname($real_file_path);
$file_dir_path = str_replace(MYBB_ROOT, '', $file_dir_path); $file_dir_path = str_replace(MYBB_ROOT, '', $file_dir_path);
$file_dir_path = ltrim($file_dir_path, './\\'); $file_dir_path = ltrim($file_dir_path, './\\');
$file_name = basename($real_file_path); $file_name = basename($real_file_path);
if(file_exists($file_path)) if(file_exists($file_path))
{ {
if(is_object($plugins))
{
$hook_args = array(
'file_path' => &$file_path,
'real_file_path' => &$real_file_path,
'file_name' => &$file_name,
'file_dir_path' => &$file_dir_path
);
$plugins->run_hooks('copy_file_to_cdn_start', $hook_args)
;
}
if($mybb->settings['usecdn'] && !empty($mybb->settings['cdnpath'] )) if($mybb->settings['usecdn'] && !empty($mybb->settings['cdnpath'] ))
{ {
$cdn_path = rtrim($mybb->settings['cdnpath'], '/\\'); $cdn_path = rtrim($mybb->settings['cdnpath'], '/\\');
if(substr($file_dir_path, 0, my_strlen(MYBB_ROOT)) == MYB B_ROOT) if(substr($file_dir_path, 0, my_strlen(MYBB_ROOT)) == MYB B_ROOT)
{ {
$file_dir_path = str_replace(MYBB_ROOT, '', $file _dir_path); $file_dir_path = str_replace(MYBB_ROOT, '', $file _dir_path);
} }
$cdn_upload_path = $cdn_path . DIRECTORY_SEPARATOR . $fil e_dir_path; $cdn_upload_path = $cdn_path . DIRECTORY_SEPARATOR . $fil e_dir_path;
 End of changes. 47 change blocks. 
61 lines changed or deleted 237 lines changed or added

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