diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 15 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/auth.php | 4 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 3 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 5 | ||||
-rw-r--r-- | phpBB/includes/session.php | 8 |
6 files changed, 31 insertions, 6 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 4ab47ec9d6..e2ee126479 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -184,7 +184,18 @@ class acp_attachments } // We strip eventually manual added convert program, we only want the patch - $this->new_config['img_imagick'] = str_replace(array('convert', '.exe'), array('', ''), $this->new_config['img_imagick']); + if ($this->new_config['img_imagick']) + { + // Change path separator + $this->new_config['img_magick'] = str_replace('\\', '/', $this->new_config['img_magick']); + $this->new_config['img_imagick'] = str_replace(array('convert', '.exe'), array('', ''), $this->new_config['img_imagick']); + + // Check for trailing slash + if (substr($this->new_config['img_magick'], -1) !== '/') + { + $this->new_config['img_magick'] .= '/'; + } + } $supported_types = get_supported_image_types(); @@ -1134,7 +1145,7 @@ class acp_attachments foreach ($locations as $location) { // The path might not end properly, fudge it - if (substr($location, -1, 1) !== '/') + if (substr($location, -1) !== '/') { $location .= '/'; } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 13612cf363..8279bf92b4 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -630,7 +630,7 @@ class acp_users } $forum_id_ary = array_unique($forum_id_ary); - $topic_id_ary = array_unique(array_merge($topic_id_ary, $new_topic_id_ary)); + $topic_id_ary = array_unique(array_merge(array_keys($topic_id_ary), $new_topic_id_ary)); if (sizeof($topic_id_ary)) { diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 78e42f0195..c64f27cee5 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -773,6 +773,10 @@ class auth_admin extends auth $cache->destroy('_acl_options'); $this->acl_clear_prefetch(); + // Because we just changed the options and also purged the options cache, we instantly update/regenerate it for later calls to succeed. + $this->option_ids = $this->acl_options = array(); + $this->__construct(); + return true; } diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index a9b037787c..77b090bf0a 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -371,7 +371,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $s_subforums_list = array(); foreach ($subforums_list as $subforum) { - $s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '">' . $subforum['name'] . '</a>'; + $s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['NEW_POSTS'] : $user->lang['NO_NEW_POSTS']) . '">' . $subforum['name'] . '</a>'; } $s_subforums_list = (string) implode(', ', $s_subforums_list); $catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false; @@ -409,6 +409,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $l_post_click_count => $post_click_count, 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt), 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'), + 'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '', 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '', 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'LAST_POST_SUBJECT' => censor_text($last_post_subject), diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 020ba0e0e3..664ed7dd27 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -618,6 +618,11 @@ function create_thumbnail($source, $destination, $mimetype) // Only use imagemagick if defined and the passthru function not disabled if ($config['img_imagick'] && function_exists('passthru')) { + if (substr($config['img_magick'], -1) !== '/') + { + $config['img_magick'] .= '/'; + } + @passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -antialias -sample ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" +profile "*" "' . str_replace('\\', '/', $destination) . '"'); if (file_exists($destination)) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 1f62abc93d..f839b1324f 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -872,7 +872,11 @@ class session /** * Sets a cookie * - * Sets a cookie of the given name with the specified data for the given length of time. + * Sets a cookie of the given name with the specified data for the given length of time. If no time is specified, a session cookie will be set. + * + * @param string $name Name of the cookie, will be automatically prefixed with the phpBB cookie name. track becomes [cookie_name]_track then. + * @param string $cookiedata The data to hold within the cookie + * @param int $cookietime The expiration time as UNIX timestamp. If 0 is provided, a session cookie is set. */ function set_cookie($name, $cookiedata, $cookietime) { @@ -882,7 +886,7 @@ class session $expire = gmdate('D, d-M-Y H:i:s \\G\\M\\T', $cookietime); $domain = (!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain']; - header('Set-Cookie: ' . $name_data . '; expires=' . $expire . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . '; HttpOnly', false); + header('Set-Cookie: ' . $name_data . (($cookietime) ? '; expires=' . $expire : '') . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . '; HttpOnly', false); } /** |