aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/assets/javascript/core.js5
-rw-r--r--phpBB/docs/CHANGELOG.html4
-rw-r--r--phpBB/docs/FAQ.html4
-rw-r--r--phpBB/docs/INSTALL.html4
-rw-r--r--phpBB/docs/README.html4
-rw-r--r--phpBB/docs/auth_api.html6
-rw-r--r--phpBB/docs/coding-guidelines.html10
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--phpBB/includes/message_parser.php72
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php3
-rw-r--r--phpBB/phpbb/avatar/driver/upload.php7
-rw-r--r--phpBB/phpbb/session.php58
-rw-r--r--phpBB/phpbb/template/twig/node/includecss.php2
-rw-r--r--phpBB/posting.php16
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html2
-rw-r--r--phpBB/styles/prosilver/template/simple_header.html2
-rw-r--r--tests/functional/posting_test.php81
-rw-r--r--tests/template/template_includecss_test.php8
18 files changed, 237 insertions, 53 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 953b6be0bd..36e881f5fd 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -394,8 +394,11 @@ phpbb.ajaxify = function(options) {
error: errorHandler,
cache: false
});
+
request.always(function() {
- $loadingIndicator.fadeOut(phpbb.alertTime);
+ if ($loadingIndicator && $loadingIndicator.is(':visible')) {
+ $loadingIndicator.fadeOut(phpbb.alertTime);
+ }
});
};
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index c9b292ab6d..8bd7ac47e0 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -6,7 +6,7 @@
<meta name="description" content="phpBB 3.1.x Changelog" />
<title>phpBB &bull; Changelog</title>
-<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
</head>
@@ -4979,7 +4979,7 @@
</div></div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" accesskey="z"></a>
</div>
</body>
diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html
index 0b3b421e72..4786d8d796 100644
--- a/phpBB/docs/FAQ.html
+++ b/phpBB/docs/FAQ.html
@@ -6,7 +6,7 @@
<meta name="description" content="phpBB 3.1.x frequently asked questions" />
<title>phpBB &bull; FAQ</title>
-<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
</head>
@@ -343,7 +343,7 @@ I want to sue you because i think you host an illegal board!</h2>
</div></div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" accesskey="z"></a>
</div>
</body>
diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html
index d1c0fe1438..132367dd0a 100644
--- a/phpBB/docs/INSTALL.html
+++ b/phpBB/docs/INSTALL.html
@@ -6,7 +6,7 @@
<meta name="description" content="phpBB 3.1.x Installation, updating and conversion informations" />
<title>phpBB &bull; Install</title>
-<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
</head>
@@ -507,7 +507,7 @@
</div></div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" accesskey="z"></a>
</div>
</body>
diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html
index f5ac3ecacd..21639045a3 100644
--- a/phpBB/docs/README.html
+++ b/phpBB/docs/README.html
@@ -6,7 +6,7 @@
<meta name="description" content="phpBB 3.1.x Readme" />
<title>phpBB &bull; Readme</title>
-<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
</head>
@@ -366,7 +366,7 @@
</div></div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" accesskey="z"></a>
</div>
</body>
diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html
index d571e72dd4..27d090c296 100644
--- a/phpBB/docs/auth_api.html
+++ b/phpBB/docs/auth_api.html
@@ -6,7 +6,7 @@
<meta name="description" content="This is an explanation of how to use the phpBB auth/acl API" />
<title>phpBB3 &bull; Auth API</title>
-<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
</head>
@@ -110,7 +110,7 @@ $auth = new phpbb\auth\auth();</pre>
<p>Following are the methods you are able to use.</p>
<a name="acl"></a><h3>2.i. acl</h3>
-
+
<p>The <code>acl</code> method is the initialisation routine for all the acl functions. If you intend calling any acl method you must first call this. The method takes as its one and only required parameter an associative array containing user information as stored in the database. This array must contain at least the following information; user_id, user_permissions and user_type. It is called in the following way:</p>
<div class="codebox"><pre>
@@ -285,7 +285,7 @@ $auth_admin = new auth_admin();</pre>
</div></div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" accesskey="z"></a>
</div>
</body>
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index 4c5fe73543..26189235ef 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -6,7 +6,7 @@
<meta name="description" content="Ascraeus coding guidelines document" />
<title>phpBB3 &bull; Coding Guidelines</title>
-<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
</head>
@@ -300,9 +300,9 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
<div class="indent">
<p><code>$current_user</code> is right, but <code>$currentuser</code> and <code> $currentUser</code> are not.</p>
</div>
-
+
<p>In JavaScript, variable names should use camel case:</p>
-
+
<div class="indent">
<p><code>currentUser</code> is right, but <code>currentuser</code> and <code>current_user</code> are not.</p>
</div>
@@ -431,7 +431,7 @@ function do_stuff()
...
}</pre>
</div>
-
+
<p>In JavaScript code, braces always go on the same line:</p>
<div class="codebox"><pre>
@@ -2568,7 +2568,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
</div></div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" accesskey="z"></a>
</div>
</body>
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 27c286c598..82aa91429c 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -4878,7 +4878,7 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false)
$src = 'src="' . $avatar_data['src'] . '"';
}
- $html = '<img class="avatar" ' . $src .
+ $html = '<img class="avatar" ' . $src . ' ' .
($avatar_data['width'] ? ('width="' . $avatar_data['width'] . '" ') : '') .
($avatar_data['height'] ? ('height="' . $avatar_data['height'] . '" ') : '') .
'alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 42ca9bf09d..8b3d8d9fd5 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -791,28 +791,6 @@ class bbcode_firstpass extends bbcode
else if (preg_match('#^quote(?:=&quot;(.*?)&quot;)?$#is', $buffer, $m) && substr($out, -1, 1) == '[')
{
$this->parsed_items['quote']++;
-
- // the buffer holds a valid opening tag
- if ($config['max_quote_depth'] && sizeof($close_tags) >= $config['max_quote_depth'])
- {
- if ($config['max_quote_depth'] == 1)
- {
- // Depth 1 - no nesting is allowed
- $error_ary['quote_depth'] = $user->lang('QUOTE_NO_NESTING');
- }
- else
- {
- // There are too many nested quotes
- $error_ary['quote_depth'] = $user->lang('QUOTE_DEPTH_EXCEEDED', (int) $config['max_quote_depth']);
- }
-
- $out .= $buffer . $tok;
- $tok = '[]';
- $buffer = '';
-
- continue;
- }
-
array_push($close_tags, '/quote:' . $this->bbcode_uid);
if (isset($m[1]) && $m[1])
@@ -1277,6 +1255,12 @@ class parse_message extends bbcode_firstpass
return $update_this_message ? $this->warn_msg : $return_message;
}
+ // Remove quotes that are nested too deep
+ if ($config['max_quote_depth'] > 0)
+ {
+ $this->remove_nested_quotes($config['max_quote_depth']);
+ }
+
// Check for "empty" message. We do not check here for maximum length, because bbcode, smilies, etc. can add to the length.
// The maximum length check happened before any parsings.
if ($mode === 'post' && utf8_clean_string($this->message) === '')
@@ -1856,6 +1840,50 @@ class parse_message extends bbcode_firstpass
}
/**
+ * Remove nested quotes at given depth in current parsed message
+ *
+ * @param integer $max_depth Depth limit
+ * @return null
+ */
+ public function remove_nested_quotes($max_depth)
+ {
+ // Capture all [quote] and [/quote] tags
+ preg_match_all('(\\[/?quote(?:=&quot;(.*?)&quot;)?:' . $this->bbcode_uid . '\\])', $this->message, $matches, PREG_OFFSET_CAPTURE);
+
+ // Iterate over the quote tags to mark the ranges that must be removed
+ $depth = 0;
+ $ranges = array();
+ $start_pos = 0;
+ foreach ($matches[0] as $match)
+ {
+ if ($match[0][1] === '/')
+ {
+ --$depth;
+ if ($depth == $max_depth)
+ {
+ $end_pos = $match[1] + strlen($match[0]);
+ $length = $end_pos - $start_pos;
+ $ranges[] = array($start_pos, $length);
+ }
+ }
+ else
+ {
+ ++$depth;
+ if ($depth == $max_depth + 1)
+ {
+ $start_pos = $match[1];
+ }
+ }
+ }
+
+ foreach (array_reverse($ranges) as $range)
+ {
+ list($start_pos, $length) = $range;
+ $this->message = substr_replace($this->message, '', $start_pos, $length);
+ }
+ }
+
+ /**
* Setter function for passing the plupload object
*
* @param \phpbb\plupload\plupload $plupload The plupload object
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index d81c4ce7fe..d7b9b32dbf 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -265,7 +265,9 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
* @var array message_row Array with message data
* @var array cp_row Array with senders custom profile field data
* @var array msg_data Template array with message data
+ * @var array user_info User data of the sender
* @since 3.1.0-a1
+ * @changed 3.1.6-RC1 Added user_info into event
*/
$vars = array(
'id',
@@ -276,6 +278,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'message_row',
'cp_row',
'msg_data',
+ 'user_info',
);
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_messsage', compact($vars)));
diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php
index ee36243844..73147a85a0 100644
--- a/phpBB/phpbb/avatar/driver/upload.php
+++ b/phpBB/phpbb/avatar/driver/upload.php
@@ -161,6 +161,13 @@ class upload extends \phpbb\avatar\driver\driver
return false;
}
+ // Delete current avatar if not overwritten
+ $ext = substr(strrchr($row['avatar'], '.'), 1);
+ if ($ext && $ext !== $file->get('extension'))
+ {
+ $this->delete($row);
+ }
+
return array(
'avatar' => $row['id'] . '_' . time() . '.' . $file->get('extension'),
'avatar_width' => $file->get('width'),
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php
index bedd581725..a5c8f264e0 100644
--- a/phpBB/phpbb/session.php
+++ b/phpBB/phpbb/session.php
@@ -519,7 +519,7 @@ class session
*/
function session_create($user_id = false, $set_admin = false, $persist_login = false, $viewonline = true)
{
- global $SID, $_SID, $db, $config, $cache, $phpbb_root_path, $phpEx, $phpbb_container;
+ global $SID, $_SID, $db, $config, $cache, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
$this->data = array();
@@ -893,6 +893,19 @@ class session
$_SID = '';
}
+ $session_data = $sql_ary;
+ /**
+ * Event to send new session data to extension
+ * Read-only event
+ *
+ * @event core.session_create_after
+ * @var array session_data Associative array of session keys to be updated
+ * @since 3.1.6-RC1
+ */
+ $vars = array('session_data');
+ extract($phpbb_dispatcher->trigger_event('core.session_create_after', compact($vars)));
+ unset($session_data);
+
return true;
}
@@ -906,13 +919,30 @@ class session
*/
function session_kill($new_session = true)
{
- global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx, $phpbb_container;
+ global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
WHERE session_id = '" . $db->sql_escape($this->session_id) . "'
AND session_user_id = " . (int) $this->data['user_id'];
$db->sql_query($sql);
+ $user_id = (int) $this->data['user_id'];
+ $session_id = $this->session_id;
+ /**
+ * Event to send session kill information to extension
+ * Read-only event
+ *
+ * @event core.session_kill_after
+ * @var int user_id user_id of the session user.
+ * @var string session_id current user's session_id
+ * @var bool new_session should we create new session for user
+ * @since 3.1.6-RC1
+ */
+ $vars = array('user_id', 'session_id', 'new_session');
+ extract($phpbb_dispatcher->trigger_event('core.session_kill_after', compact($vars)));
+ unset($user_id);
+ unset($session_id);
+
// Allow connecting logout with external auth method logout
$provider_collection = $phpbb_container->get('auth.provider_collection');
$provider = $provider_collection->get_provider();
@@ -980,7 +1010,7 @@ class session
*/
function session_gc()
{
- global $db, $config, $phpbb_root_path, $phpEx, $phpbb_container;
+ global $db, $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
$batch_size = 10;
@@ -1048,6 +1078,14 @@ class session
$db->sql_query($sql);
}
+ /**
+ * Event to trigger extension on session_gc
+ *
+ * @event core.session_gc_after
+ * @since 3.1.6-RC1
+ */
+ $phpbb_dispatcher->dispatch('core.session_gc_after');
+
return;
}
@@ -1541,12 +1579,24 @@ class session
*/
public function update_session($session_data, $session_id = null)
{
- global $db;
+ global $db, $phpbb_dispatcher;
$session_id = ($session_id) ? $session_id : $this->session_id;
$sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $session_data) . "
WHERE session_id = '" . $db->sql_escape($session_id) . "'";
$db->sql_query($sql);
+
+ /**
+ * Event to send update session information to extension
+ * Read-only event
+ *
+ * @event core.update_session_after
+ * @var array session_data Associative array of session keys to be updated
+ * @var string session_id current user's session_id
+ * @since 3.1.6-RC1
+ */
+ $vars = array('session_data', 'session_id');
+ extract($phpbb_dispatcher->trigger_event('core.update_session_after', compact($vars)));
}
}
diff --git a/phpBB/phpbb/template/twig/node/includecss.php b/phpBB/phpbb/template/twig/node/includecss.php
index 2ce63402aa..2dac154036 100644
--- a/phpBB/phpbb/template/twig/node/includecss.php
+++ b/phpBB/phpbb/template/twig/node/includecss.php
@@ -31,7 +31,7 @@ class includecss extends \phpbb\template\twig\node\includeasset
$compiler
->raw("<link href=\"' . ")
->raw("\$asset_file . '\"")
- ->raw(' rel="stylesheet" type="text/css" media="screen, projection" />')
+ ->raw(' rel="stylesheet" type="text/css" media="screen" />')
;
}
}
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 651f674ef9..bd36dc5db7 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1330,7 +1330,6 @@ if ($submit || $preview || $refresh)
'enable_urls' => (bool) $post_data['enable_urls'],
'enable_indexing' => (bool) $post_data['enable_indexing'],
'message_md5' => (string) $message_md5,
- 'post_time' => (isset($post_data['post_time'])) ? (int) $post_data['post_time'] : $current_time,
'post_checksum' => (isset($post_data['post_checksum'])) ? (string) $post_data['post_checksum'] : '',
'post_edit_reason' => $post_data['post_edit_reason'],
'post_edit_user' => ($mode == 'edit') ? $user->data['user_id'] : ((isset($post_data['post_edit_user'])) ? (int) $post_data['post_edit_user'] : 0),
@@ -1579,11 +1578,21 @@ if (!sizeof($error) && $preview)
}
}
+// Remove quotes that would become nested too deep before decoding the text
+$generate_quote = ($mode == 'quote' && !$submit && !$preview && !$refresh);
+if ($generate_quote && $config['max_quote_depth'] > 0)
+{
+ $tmp_bbcode_uid = $message_parser->bbcode_uid;
+ $message_parser->bbcode_uid = $post_data['bbcode_uid'];
+ $message_parser->remove_nested_quotes($config['max_quote_depth'] - 1);
+ $message_parser->bbcode_uid = $tmp_bbcode_uid;
+}
+
// Decode text for message display
$post_data['bbcode_uid'] = ($mode == 'quote' && !$preview && !$refresh && !sizeof($error)) ? $post_data['bbcode_uid'] : $message_parser->bbcode_uid;
$message_parser->decode_message($post_data['bbcode_uid']);
-if ($mode == 'quote' && !$submit && !$preview && !$refresh)
+if ($generate_quote)
{
if ($config['allow_bbcode'])
{
@@ -1841,6 +1850,7 @@ if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_
* @var int post_id ID of the post
* @var int topic_id ID of the topic
* @var int forum_id ID of the forum
+* @var int draft_id ID of the draft
* @var bool submit Whether or not the form has been submitted
* @var bool preview Whether or not the post is being previewed
* @var bool save Whether or not a draft is being saved
@@ -1863,6 +1873,7 @@ if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_
* delete, cancel, refresh, error, page_data, message_parser
* @change 3.1.2-RC1 Removed 'delete' var as it does not exist
* @change 3.1.5-RC1 Added poll variables to the page_data array
+* @change 3.1.6-RC1 Added 'draft_id' var
*/
$vars = array(
'post_data',
@@ -1876,6 +1887,7 @@ $vars = array(
'post_id',
'topic_id',
'forum_id',
+ 'draft_id',
'submit',
'preview',
'save',
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index 2b2036883b..ebe6470fee 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -31,7 +31,7 @@
<script>
WebFontConfig = {
google: {
- families: ['Open Sans:n6']
+ families: ['Open+Sans:600:cyrillic-ext,latin,greek-ext,greek,vietnamese,latin-ext,cyrillic']
}
};
diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html
index 637ac59465..baa6223754 100644
--- a/phpBB/styles/prosilver/template/simple_header.html
+++ b/phpBB/styles/prosilver/template/simple_header.html
@@ -10,7 +10,7 @@
<script>
WebFontConfig = {
google: {
- families: ['Open Sans:n6']
+ families: ['Open+Sans:600:cyrillic-ext,latin,greek-ext,greek,vietnamese,latin-ext,cyrillic']
}
};
diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php
index fd802eed45..33632a01e1 100644
--- a/tests/functional/posting_test.php
+++ b/tests/functional/posting_test.php
@@ -59,4 +59,85 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
'Your subject contains the following unsupported characters'
);
}
+
+ /**
+ * @testdox max_quote_depth is applied to the text populating the posting form
+ */
+ public function test_quote_depth_form()
+ {
+ $text = '0[quote]1[quote]2[/quote]1[/quote]0';
+ $expected = array(
+ 0 => '[quote="admin"]0[quote]1[quote]2[/quote]1[/quote]0[/quote]',
+ 1 => '[quote="admin"]00[/quote]',
+ 2 => '[quote="admin"]0[quote]11[/quote]0[/quote]',
+ 3 => '[quote="admin"]0[quote]1[quote]2[/quote]1[/quote]0[/quote]',
+ );
+
+ $this->login();
+ $topic = $this->create_topic(2, 'Test Topic 1', 'Test topic');
+ $post = $this->create_post(2, $topic['topic_id'], 'Re: Test Topic 1', $text);
+ $quote_url = "posting.php?mode=quote&f=2&t={$post['topic_id']}&p={$post['post_id']}&sid={$this->sid}";
+
+ $this->admin_login();
+ foreach ($expected as $quote_depth => $expected_text)
+ {
+ $this->set_quote_depth($quote_depth);
+ $crawler = self::request('GET', $quote_url);
+ $this->assertContains($expected_text, $crawler->filter('textarea#message')->text());
+ }
+ }
+
+ /**
+ * @testdox max_quote_depth is applied to the submitted text
+ */
+ public function test_quote_depth_submit()
+ {
+ $text = 'depth:0[quote]depth:1[quote]depth:2[quote]depth:3[/quote][/quote][/quote]';
+ $contains = array(
+ 0 => array('depth:0', 'depth:1', 'depth:2', 'depth:3'),
+ 1 => array('depth:0', 'depth:1'),
+ 2 => array('depth:0', 'depth:1', 'depth:2'),
+ 3 => array('depth:0', 'depth:1', 'depth:2', 'depth:3'),
+ );
+ $not_contains = array(
+ 0 => array(),
+ 1 => array('depth:2', 'depth:3'),
+ 2 => array('depth:3'),
+ 3 => array(),
+ );
+
+ $this->login();
+ $this->admin_login();
+ $topic = $this->create_topic(2, 'Test Topic 1', 'Test topic');
+
+ for ($quote_depth = 0; $quote_depth <= 2; ++$quote_depth)
+ {
+ $this->set_quote_depth($quote_depth);
+
+ $post = $this->create_post(2, $topic['topic_id'], 'Re: Test Topic 1', $text);
+ $url = "viewtopic.php?p={$post['post_id']}&sid={$this->sid}";
+
+ $crawler = self::request('GET', $url);
+ $text_content = $crawler->filter('#p' . $post['post_id'])->text();
+ foreach ($contains[$quote_depth] as $contains_text)
+ {
+ $this->assertContains($contains_text, $text_content);
+ }
+ foreach ($not_contains[$quote_depth] as $not_contains_text)
+ {
+ $this->assertNotContains($not_contains_text, $text_content);
+ }
+ }
+ }
+
+ protected function set_quote_depth($depth)
+ {
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post');
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+ $values['config[max_quote_depth]'] = $depth;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+ $this->assertEquals(1, $crawler->filter('.successbox')->count());
+ }
}
diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php
index 49bd9dec8b..4ef9b90ec4 100644
--- a/tests/template/template_includecss_test.php
+++ b/tests/template/template_includecss_test.php
@@ -71,19 +71,19 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
*/
array(
array('TEST' => 1),
- '<link href="tests/template/templates/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
+ '<link href="tests/template/templates/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen" />',
),
array(
array('TEST' => 2),
- '<link href="tests/template/parent_templates/parent_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
+ '<link href="tests/template/parent_templates/parent_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen" />',
),
array(
array('TEST' => 3),
- '<link href="' . $url_base . '/ext/include/css/styles/all/theme/test.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
+ '<link href="' . $url_base . '/ext/include/css/styles/all/theme/test.css?assets_version=1" rel="stylesheet" type="text/css" media="screen" />',
),
array(
array('TEST' => 4),
- '<link href="' . $url_base . '/ext/include/css/styles/all/theme/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
+ '<link href="' . $url_base . '/ext/include/css/styles/all/theme/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen" />',
),
);
}