aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2013-07-22 00:32:35 +0200
committerAndreas Fischer <bantu@phpbb.com>2013-07-22 00:32:35 +0200
commit148df3607b230dfd77aa426657ce27b6d24e396b (patch)
tree56f71449c67bb9c4a7ae9557e73f416f554fcc9d
parent9e789c4e9f3e5b4b0697cd900a24467b7be9a71f (diff)
parent865bf0db3d5ca3f8bbadd009ce0a5e8324de49c1 (diff)
downloadforums-148df3607b230dfd77aa426657ce27b6d24e396b.tar
forums-148df3607b230dfd77aa426657ce27b6d24e396b.tar.gz
forums-148df3607b230dfd77aa426657ce27b6d24e396b.tar.bz2
forums-148df3607b230dfd77aa426657ce27b6d24e396b.tar.xz
forums-148df3607b230dfd77aa426657ce27b6d24e396b.zip
Merge remote-tracking branch 'marc1706/ticket/11720-prep-release' into prep-release-3.0.12
* marc1706/ticket/11720-prep-release: [ticket/11720] Add functional test for submitting report as user [ticket/11720] Do not call $captcha->validate if $captcha is not set
-rw-r--r--phpBB/report.php9
-rw-r--r--tests/functional/report_post_captcha_test.php (renamed from tests/functional/report_post_captcha.php)19
2 files changed, 18 insertions, 10 deletions
diff --git a/phpBB/report.php b/phpBB/report.php
index c92ecdfdcc..c909b4fcf3 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -146,10 +146,13 @@ $s_hidden_fields = '';
// Submit report?
if ($submit && $reason_id)
{
- $visual_confirmation_response = $captcha->validate();
- if ($visual_confirmation_response)
+ if (isset($captcha))
{
- $error[] = $visual_confirmation_response;
+ $visual_confirmation_response = $captcha->validate();
+ if ($visual_confirmation_response)
+ {
+ $error[] = $visual_confirmation_response;
+ }
}
$sql = 'SELECT *
diff --git a/tests/functional/report_post_captcha.php b/tests/functional/report_post_captcha_test.php
index af713775c5..8283465041 100644
--- a/tests/functional/report_post_captcha.php
+++ b/tests/functional/report_post_captcha_test.php
@@ -12,13 +12,6 @@
*/
class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_case
{
- public function test_user_report_post()
- {
- $this->login();
- $crawler = self::request('GET', 'report.php?f=2&p=1');
- $this->assertNotContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text());
- }
-
public function test_guest_report_post()
{
$crawler = self::request('GET', 'report.php?f=2&p=1');
@@ -31,6 +24,18 @@ class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_ca
$this->set_reporting_guest(-1);
}
+ public function test_user_report_post()
+ {
+ $this->login();
+ $crawler = self::request('GET', 'report.php?f=2&p=1');
+ $this->assertNotContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text());
+
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('POST_REPORTED_SUCCESS'), $crawler->text());
+ }
+
protected function set_reporting_guest($report_post_allowed)
{
$this->login();