aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2010-08-22 21:54:08 +0200
committerAndreas Fischer <bantu@phpbb.com>2010-08-22 21:54:08 +0200
commitc4a65a469709a8ffdeb52f9d3556545993f2347a (patch)
tree8c48a3982cd5b4182145d8923fd3f10d6a6b4e98
parentdfa53bfe9a21e25ae86ff954e2d9da8bdec6c317 (diff)
parentcd46b399678db9f7a10f6395b2920135800c41fd (diff)
downloadforums-c4a65a469709a8ffdeb52f9d3556545993f2347a.tar
forums-c4a65a469709a8ffdeb52f9d3556545993f2347a.tar.gz
forums-c4a65a469709a8ffdeb52f9d3556545993f2347a.tar.bz2
forums-c4a65a469709a8ffdeb52f9d3556545993f2347a.tar.xz
forums-c4a65a469709a8ffdeb52f9d3556545993f2347a.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/7260] Don't delete poll if one exists and editing user lacks permission [ticket/9646] Honor CSS comments in @import statements
-rw-r--r--phpBB/includes/acp/acp_styles.php12
-rw-r--r--phpBB/posting.php26
2 files changed, 36 insertions, 2 deletions
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 3310560c73..95b700c876 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -2531,13 +2531,21 @@ parse_css_file = {PARSE_CSS_FILE}
// Match CSS imports
$matches = array();
- preg_match_all('/@import url\(["\'](.*)["\']\);/i', $stylesheet, $matches);
+ preg_match_all('/@import url\((["\'])(.*)\1\);/i', $stylesheet, $matches);
+
+ // remove commented stylesheets (very simple parser, allows only whitespace
+ // around an @import statement)
+ preg_match_all('#/\*\s*@import url\((["\'])(.*)\1\);\s\*/#i', $stylesheet, $commented);
+ $matches[2] = array_diff($matches[2], $commented[2]);
if (sizeof($matches))
{
foreach ($matches[0] as $idx => $match)
{
- $stylesheet = str_replace($match, acp_styles::load_css_file($theme_row['theme_path'], $matches[1][$idx]), $stylesheet);
+ if (isset($matches[2][$idx]))
+ {
+ $stylesheet = str_replace($match, acp_styles::load_css_file($theme_row['theme_path'], $matches[2][$idx]), $stylesheet);
+ }
}
}
diff --git a/phpBB/posting.php b/phpBB/posting.php
index df063ef391..8cacac2910 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -402,6 +402,16 @@ if ($post_data['poll_start'])
$db->sql_freeresult($result);
}
+$original_poll_data = array(
+ 'poll_title' => $post_data['poll_title'],
+ 'poll_length' => $post_data['poll_length'],
+ 'poll_max_options' => $post_data['poll_max_options'],
+ 'poll_option_text' => implode("\n", $post_data['poll_options']),
+ 'poll_start' => $post_data['poll_start'],
+ 'poll_last_vote' => $post_data['poll_last_vote'],
+ 'poll_vote_change' => $post_data['poll_vote_change'],
+);
+
$orig_poll_options_size = sizeof($post_data['poll_options']);
$message_parser = new parse_message();
@@ -912,6 +922,22 @@ if ($submit || $preview || $refresh)
$message_parser->warn_msg[] = $user->lang['NO_DELETE_POLL_OPTIONS'];
}*/
}
+ else if (!$auth->acl_get('f_poll', $forum_id) && ($mode == 'edit') && ($post_id == $post_data['topic_first_post_id']) && ($original_poll_data['poll_title'] != ''))
+ {
+ // We have a poll but the editing user is not permitted to create/edit it.
+ // So we just keep the original poll-data.
+ $poll = array_merge($original_poll_data, array(
+ 'enable_bbcode' => $post_data['enable_bbcode'],
+ 'enable_urls' => $post_data['enable_urls'],
+ 'enable_smilies' => $post_data['enable_smilies'],
+ 'img_status' => $img_status,
+ ));
+
+ $message_parser->parse_poll($poll);
+
+ $post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : '';
+ $post_data['poll_title'] = (isset($poll['poll_title'])) ? $poll['poll_title'] : '';
+ }
else
{
$poll = array();