Merge remote-tracking branch 'upstream/develop' into ticket/10665

* upstream/develop:
  [ticket/10733] Fixing test
  [ticket/10733] Removing static from data providers
  [ticket/10731] Fixed addquote() to work on opera browser.
  [ticket/10731] Fixed addquote() to work on opera browser.
  [Ticket/10675] Correct language string ATTACH_DISK_FULL
  [feature/event-dispatcher] Adding composer.phar to .gitignore for olympus
  [ticket/10705] Change WARNINGS_ZERO_TOTAL in subsilver2
  [ticket/10705] Change WARNINGS_ZERO_TOTAL in prosilver
  [ticket/10705] Change WARNINGS_ZERO_TOTAL in en language
  [ticket/10675] Add disk full language string when posting attachments
This commit is contained in:
Vjacheslav Trushkin 2012-04-01 19:28:37 +03:00
commit b548389207
20 changed files with 51 additions and 43 deletions

View file

@ -495,8 +495,15 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
if ($free_space = @disk_free_space($phpbb_root_path . $config['upload_path'])) if ($free_space = @disk_free_space($phpbb_root_path . $config['upload_path']))
{ {
if ($free_space <= $file->get('filesize')) if ($free_space <= $file->get('filesize'))
{
if ($auth->acl_get('a_'))
{
$filedata['error'][] = $user->lang['ATTACH_DISK_FULL'];
}
else
{ {
$filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED']; $filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED'];
}
$filedata['post_attach'] = false; $filedata['post_attach'] = false;
$file->remove(); $file->remove();

View file

@ -389,7 +389,7 @@ $lang = array_merge($lang, array(
'WARNING_PM_BODY' => 'The following is a warning which has been issued to you by an administrator or moderator of this site.[quote]%s[/quote]', 'WARNING_PM_BODY' => 'The following is a warning which has been issued to you by an administrator or moderator of this site.[quote]%s[/quote]',
'WARNING_PM_SUBJECT' => 'Board warning issued', 'WARNING_PM_SUBJECT' => 'Board warning issued',
'WARNING_POST_DEFAULT' => 'This is a warning regarding the following post made by you: %s .', 'WARNING_POST_DEFAULT' => 'This is a warning regarding the following post made by you: %s .',
'WARNINGS_ZERO_TOTAL' => 'No warnings exist.', 'NO_WARNINGS' => 'No warnings exist.',
'YOU_SELECTED_TOPIC' => 'You selected topic number %d: %s.', 'YOU_SELECTED_TOPIC' => 'You selected topic number %d: %s.',

View file

@ -41,6 +41,7 @@ $lang = array_merge($lang, array(
'ADD_POLL' => 'Poll creation', 'ADD_POLL' => 'Poll creation',
'ADD_POLL_EXPLAIN' => 'If you do not want to add a poll to your topic leave the fields blank.', 'ADD_POLL_EXPLAIN' => 'If you do not want to add a poll to your topic leave the fields blank.',
'ALREADY_DELETED' => 'Sorry but this message is already deleted.', 'ALREADY_DELETED' => 'Sorry but this message is already deleted.',
'ATTACH_DISK_FULL' => 'There is not enough free disk space to post this attachment.',
'ATTACH_QUOTA_REACHED' => 'Sorry, the board attachment quota has been reached.', 'ATTACH_QUOTA_REACHED' => 'Sorry, the board attachment quota has been reached.',
'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)', 'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)',

View file

@ -219,7 +219,7 @@ function addquote(post_id, username, l_wrote)
// Get text selection - not only the post content :( // Get text selection - not only the post content :(
// IE9 must use the document.selection method but has the *.getSelection so we just force no IE // IE9 must use the document.selection method but has the *.getSelection so we just force no IE
if (window.getSelection && !is_ie) if (window.getSelection && !is_ie && !window.opera)
{ {
theSelection = window.getSelection().toString(); theSelection = window.getSelection().toString();
} }

View file

@ -55,7 +55,7 @@
</tbody> </tbody>
</table> </table>
<!-- ELSE --> <!-- ELSE -->
<p><strong>{L_WARNINGS_ZERO_TOTAL}</strong></p> <p><strong>{L_NO_WARNINGS}</strong></p>
<!-- ENDIF --> <!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div> <span class="corners-bottom"><span></span></span></div>
@ -88,7 +88,7 @@
</tbody> </tbody>
</table> </table>
<!-- ELSE --> <!-- ELSE -->
<p><strong>{L_WARNINGS_ZERO_TOTAL}</strong></p> <p><strong>{L_NO_WARNINGS}</strong></p>
<!-- ENDIF --> <!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div> <span class="corners-bottom"><span></span></span></div>

View file

@ -53,7 +53,7 @@
</li> </li>
</ul> </ul>
<!-- ELSE --> <!-- ELSE -->
<p><strong>{L_WARNINGS_ZERO_TOTAL}</strong></p> <p><strong>{L_NO_WARNINGS}</strong></p>
<!-- ENDIF --> <!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div> <span class="corners-bottom"><span></span></span></div>

View file

@ -221,7 +221,7 @@ function addquote(post_id, username, l_wrote)
// Get text selection - not only the post content :( // Get text selection - not only the post content :(
// IE9 must use the document.selection method but has the *.getSelection so we just force no IE // IE9 must use the document.selection method but has the *.getSelection so we just force no IE
if (window.getSelection && !is_ie) if (window.getSelection && !is_ie && !window.opera)
{ {
theSelection = window.getSelection().toString(); theSelection = window.getSelection().toString();
} }

View file

@ -38,7 +38,7 @@
</tr> </tr>
<!-- BEGINELSE --> <!-- BEGINELSE -->
<tr> <tr>
<td class="row1" colspan="4" align="center"><span class="gen">{L_WARNINGS_ZERO_TOTAL}</span></td> <td class="row1" colspan="4" align="center"><span class="gen">{L_NO_WARNINGS}</span></td>
</tr> </tr>
<!-- END highest --> <!-- END highest -->
</table> </table>
@ -64,7 +64,7 @@
</tr> </tr>
<!-- BEGINELSE --> <!-- BEGINELSE -->
<tr> <tr>
<td class="row1" colspan="4" align="center"><span class="gen">{L_WARNINGS_ZERO_TOTAL}</span></td> <td class="row1" colspan="4" align="center"><span class="gen">{L_NO_WARNINGS}</span></td>
</tr> </tr>
<!-- END latest --> <!-- END latest -->
</table> </table>

View file

@ -21,7 +21,7 @@
</tr> </tr>
<!-- BEGINELSE --> <!-- BEGINELSE -->
<tr> <tr>
<td class="row1" colspan="4" align="center"><span class="gen">{L_WARNINGS_ZERO_TOTAL}</span></td> <td class="row1" colspan="4" align="center"><span class="gen">{L_NO_WARNINGS}</span></td>
</tr> </tr>
<!-- END user --> <!-- END user -->
<tr align="center"> <tr align="center">

View file

@ -17,7 +17,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/three_users.xml'); return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/three_users.xml');
} }
public static function return_on_error_select_data() public function return_on_error_select_data()
{ {
return array( return array(
array('phpbb_users', "username_clean = 'bertie'", array(array('username_clean' => 'bertie'))), array('phpbb_users', "username_clean = 'bertie'", array(array('username_clean' => 'bertie'))),
@ -44,7 +44,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $db->sql_fetchrowset($result)); $this->assertEquals($expected, $db->sql_fetchrowset($result));
} }
public static function fetchrow_data() public function fetchrow_data()
{ {
return array( return array(
array('', array(array('username_clean' => 'barfoo'), array('', array(array('username_clean' => 'barfoo'),
@ -95,7 +95,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
public static function fetchfield_data() public function fetchfield_data()
{ {
return array( return array(
array('', array('barfoo', 'foobar', 'bertie')), array('', array('barfoo', 'foobar', 'bertie')),
@ -125,7 +125,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $ary); $this->assertEquals($expected, $ary);
} }
public static function query_limit_data() public function query_limit_data()
{ {
return array( return array(
array(0, 0, array(array('username_clean' => 'barfoo'), array(0, 0, array(array('username_clean' => 'barfoo'),
@ -166,7 +166,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $ary); $this->assertEquals($expected, $ary);
} }
public static function like_expression_data() public function like_expression_data()
{ {
// * = any_char; # = one_char // * = any_char; # = one_char
return array( return array(
@ -203,7 +203,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
public static function in_set_data() public function in_set_data()
{ {
return array( return array(
array('user_id', 3, false, false, array(array('username_clean' => 'bertie'))), array('user_id', 3, false, false, array(array('username_clean' => 'bertie'))),
@ -277,7 +277,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
public static function build_array_data() public function build_array_data()
{ {
return array( return array(
array(array('username_clean' => 'barfoo'), array(array('username_clean' => 'barfoo'))), array(array('username_clean' => 'barfoo'), array(array('username_clean' => 'barfoo'))),

View file

@ -16,7 +16,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml'); return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml');
} }
public static function build_array_insert_data() public function build_array_insert_data()
{ {
return array( return array(
array(array( array(array(
@ -104,7 +104,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
public static function update_data() public function update_data()
{ {
return array( return array(
array( array(

View file

@ -15,7 +15,7 @@ class phpbb_group_positions_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/group_positions.xml'); return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/group_positions.xml');
} }
public static function get_group_value_data() public function get_group_value_data()
{ {
return array( return array(
array('teampage', 1, 0), array('teampage', 1, 0),
@ -38,7 +38,7 @@ class phpbb_group_positions_test extends phpbb_database_test_case
$this->assertEquals($expected, $test_class->get_group_value($group_id)); $this->assertEquals($expected, $test_class->get_group_value($group_id));
} }
public static function get_group_count_data() public function get_group_count_data()
{ {
return array( return array(
array('teampage', 2), array('teampage', 2),
@ -59,7 +59,7 @@ class phpbb_group_positions_test extends phpbb_database_test_case
$this->assertEquals($expected, $test_class->get_group_count()); $this->assertEquals($expected, $test_class->get_group_count());
} }
public static function add_group_data() public function add_group_data()
{ {
return array( return array(
array('teampage', 1, array( array('teampage', 1, array(
@ -93,7 +93,7 @@ class phpbb_group_positions_test extends phpbb_database_test_case
$this->assertEquals($expected, $db->sql_fetchrowset($result)); $this->assertEquals($expected, $db->sql_fetchrowset($result));
} }
public static function delete_group_data() public function delete_group_data()
{ {
return array( return array(
array('teampage', 1, false, array( array('teampage', 1, false, array(
@ -147,7 +147,7 @@ class phpbb_group_positions_test extends phpbb_database_test_case
$this->assertEquals($expected, $db->sql_fetchrowset($result)); $this->assertEquals($expected, $db->sql_fetchrowset($result));
} }
public static function move_up_data() public function move_up_data()
{ {
return array( return array(
array('teampage', 1, array( array('teampage', 1, array(
@ -186,7 +186,7 @@ class phpbb_group_positions_test extends phpbb_database_test_case
$this->assertEquals($expected, $db->sql_fetchrowset($result)); $this->assertEquals($expected, $db->sql_fetchrowset($result));
} }
public static function move_down_data() public function move_down_data()
{ {
return array( return array(
array('teampage', 1, array( array('teampage', 1, array(
@ -225,7 +225,7 @@ class phpbb_group_positions_test extends phpbb_database_test_case
$this->assertEquals($expected, $db->sql_fetchrowset($result)); $this->assertEquals($expected, $db->sql_fetchrowset($result));
} }
public static function move_data() public function move_data()
{ {
return array( return array(
array('teampage', 1, 1, array( array('teampage', 1, 1, array(

View file

@ -112,7 +112,7 @@ class phpbb_request_var_test extends phpbb_test_case
$this->assertEquals($expected, $result, 'Testing deep access to multidimensional input arrays: ' . $path); $this->assertEquals($expected, $result, 'Testing deep access to multidimensional input arrays: ' . $path);
} }
public static function deep_access() public function deep_access()
{ {
return array( return array(
// array(path, default, expected result) // array(path, default, expected result)
@ -123,7 +123,7 @@ class phpbb_request_var_test extends phpbb_test_case
); );
} }
public static function request_variables() public function request_variables()
{ {
return array( return array(
// strings // strings

View file

@ -13,7 +13,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_security_extract_current_page_test extends phpbb_security_test_base class phpbb_security_extract_current_page_test extends phpbb_security_test_base
{ {
public static function security_variables() public function security_variables()
{ {
return array( return array(
array('http://localhost/phpBB/index.php', 'mark=forums&x="><script>alert(/XSS/);</script>', 'mark=forums&x=%22%3E%3Cscript%3Ealert(/XSS/);%3C/script%3E'), array('http://localhost/phpBB/index.php', 'mark=forums&x="><script>alert(/XSS/);</script>', 'mark=forums&x=%22%3E%3Cscript%3Ealert(/XSS/);%3C/script%3E'),

View file

@ -13,7 +13,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_security_redirect_test extends phpbb_security_test_base class phpbb_security_redirect_test extends phpbb_security_test_base
{ {
public static function provider() public function provider()
{ {
// array(Input -> redirect(), expected triggered error (else false), expected returned result url (else false)) // array(Input -> redirect(), expected triggered error (else false), expected returned result url (else false))
return array( return array(

View file

@ -14,7 +14,7 @@ class phpbb_template_template_inheritance_test extends phpbb_template_template_t
/** /**
* @todo put test data into templates/xyz.test * @todo put test data into templates/xyz.test
*/ */
public static function template_data() public function template_data()
{ {
return array( return array(
// First element of the array is test name - keep them distinct // First element of the array is test name - keep them distinct

View file

@ -11,44 +11,44 @@ require_once dirname(__FILE__) . '/template_test_case.php';
class phpbb_template_template_locate_test extends phpbb_template_template_test_case class phpbb_template_template_locate_test extends phpbb_template_template_test_case
{ {
public static function template_data() public function template_data()
{ {
return array( return array(
// First element of the array is test name - keep them distinct // First element of the array is test name - keep them distinct
array( array(
'simple inheritance - only parent template exists', 'simple inheritance - only parent template exists',
dirname(__FILE__) . '/parent_templates/parent_only.html',
'parent_only.html', 'parent_only.html',
false, false,
true, true,
dirname(__FILE__) . '/parent_templates/parent_only.html',
), ),
array( array(
'simple inheritance - only child template exists', 'simple inheritance - only child template exists',
dirname(__FILE__) . '/templates/child_only.html',
'child_only.html', 'child_only.html',
false, false,
true, true,
dirname(__FILE__) . '/templates/child_only.html',
), ),
array( array(
'simple inheritance - both parent and child templates exist', 'simple inheritance - both parent and child templates exist',
dirname(__FILE__) . '/templates/parent_and_child.html',
'parent_and_child.html', 'parent_and_child.html',
false, false,
true, true,
dirname(__FILE__) . '/templates/parent_and_child.html',
), ),
array( array(
'find first template - only child template exists in main style', 'find first template - only child template exists in main style',
'child_only.html',
array('parent_only.html', 'child_only.html'), array('parent_only.html', 'child_only.html'),
false, false,
false, false,
'child_only.html',
), ),
array( array(
'find first template - both templates exist in main style', 'find first template - both templates exist in main style',
'parent_and_child.html',
array('parent_and_child.html', 'child_only.html'), array('parent_and_child.html', 'child_only.html'),
false, false,
false, false,
'parent_and_child.html',
), ),
); );
} }
@ -56,14 +56,14 @@ class phpbb_template_template_locate_test extends phpbb_template_template_test_c
/** /**
* @dataProvider template_data * @dataProvider template_data
*/ */
public function test_template($name, $files, $return_default, $return_full_path, $expected) public function test_template($name, $expected, $files, $return_default, $return_full_path)
{ {
// Reset the engine state // Reset the engine state
$this->setup_engine(); $this->setup_engine();
// Locate template // Locate template
$result = $this->template->locate($files, $return_default, $return_full_path); $result = $this->template->locate($files, $return_default, $return_full_path);
$this->assertEquals($result, $expected); $this->assertSame($expected, $result);
} }
protected function setup_engine(array $new_config = array()) protected function setup_engine(array $new_config = array())

View file

@ -15,7 +15,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
/** /**
* @todo put test data into templates/xyz.test * @todo put test data into templates/xyz.test
*/ */
public static function template_data() public function template_data()
{ {
return array( return array(
/* /*
@ -394,7 +394,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
$this->run_template('php.html', array(), array(), array(), 'test', $cache_file); $this->run_template('php.html', array(), array(), array(), 'test', $cache_file);
} }
public static function alter_block_array_data() public function alter_block_array_data()
{ {
return array( return array(
array( array(

View file

@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
class phpbb_text_processing_make_clickable_test extends phpbb_test_case class phpbb_text_processing_make_clickable_test extends phpbb_test_case
{ {
public static function make_clickable_data() public function make_clickable_data()
{ {
// value => whether it should work // value => whether it should work
$prefix_texts = array( $prefix_texts = array(

View file

@ -11,7 +11,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
class phpbb_utf_utf8_clean_string_test extends phpbb_test_case class phpbb_utf_utf8_clean_string_test extends phpbb_test_case
{ {
public static function cleanable_strings() public function cleanable_strings()
{ {
return array( return array(
array('MiXed CaSe', 'mixed case', 'Checking case folding'), array('MiXed CaSe', 'mixed case', 'Checking case folding'),