Skip to content

Commit 57668ed

Browse files
authored
Merge pull request #310 from VSEphpbb/updates
Minor post validation code fixes
2 parents 6f31e5a + 4689a2b commit 57668ed

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

acp/boardrules_module.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ class boardrules_module
1818

1919
public function main($id, $mode)
2020
{
21-
global $phpbb_container, $request;
21+
global $phpbb_container;
2222

2323
/** @var \phpbb\language\language $lang */
2424
$lang = $phpbb_container->get('language');
2525

26+
/** @var \phpbb\request\request $request */
27+
$request = $phpbb_container->get('request');
28+
2629
// Add the board rules ACP lang file
2730
$lang->add_lang('boardrules_acp', 'phpbb/boardrules');
2831

controller/admin_controller.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ public function add_rule($language = 0, $parent_id = 0)
293293
add_form_key('add_edit_rule');
294294

295295
// Initiate a rule entity
296+
/* @var $entity \phpbb\boardrules\entity\rule */
296297
$entity = $this->container->get('phpbb.boardrules.entity');
297298

298299
// Collect the form data
@@ -459,7 +460,7 @@ protected function add_edit_rule_data($entity, $data)
459460
}
460461
catch (\phpbb\boardrules\exception\out_of_bounds $e)
461462
{
462-
trigger_error($e->get_message($this->user) . adm_back_link($this->u_action), E_USER_WARNING);
463+
trigger_error($e->get_message($this->lang) . adm_back_link($this->u_action), E_USER_WARNING);
463464
}
464465

465466
// Change rule parent
@@ -471,7 +472,7 @@ protected function add_edit_rule_data($entity, $data)
471472
}
472473
catch (\Exception $e)
473474
{
474-
trigger_error($this->user->lang($e->getMessage()) . adm_back_link($this->u_action), E_USER_WARNING);
475+
trigger_error($this->lang->lang($e->getMessage()) . adm_back_link($this->u_action), E_USER_WARNING);
475476
}
476477
}
477478

@@ -487,7 +488,7 @@ protected function add_edit_rule_data($entity, $data)
487488
}
488489
catch (\phpbb\boardrules\exception\out_of_bounds $e)
489490
{
490-
trigger_error($e->get_message($this->user) . adm_back_link($this->u_action), E_USER_WARNING);
491+
trigger_error($e->get_message($this->lang) . adm_back_link($this->u_action), E_USER_WARNING);
491492
}
492493

493494
// Show user confirmation of the added rule and provide link back to the previous page
@@ -555,7 +556,7 @@ public function delete_rule($rule_id)
555556
}
556557
catch (\Exception $e)
557558
{
558-
trigger_error($this->user->lang($e->getMessage()) . adm_back_link($this->u_action), E_USER_WARNING);
559+
trigger_error($this->lang->lang($e->getMessage()) . adm_back_link($this->u_action), E_USER_WARNING);
559560
}
560561

561562
// Show user confirmation of the deleted rule and provide link back to the previous page
@@ -600,7 +601,7 @@ public function move_rule($rule_id, $direction, $amount = 1)
600601
}
601602
catch (\Exception $e)
602603
{
603-
trigger_error($this->user->lang($e->getMessage()) . adm_back_link($this->u_action), E_USER_WARNING);
604+
trigger_error($this->lang->lang($e->getMessage()) . adm_back_link($this->u_action), E_USER_WARNING);
604605
}
605606

606607
// Send a JSON response if an AJAX request was used

operators/rule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function get_rules($language = 0, $parent_id = 0)
7474
* @param \phpbb\boardrules\entity\rule_interface $entity Rule entity with new data to insert
7575
* @param int $language Language selection identifier; default: 0
7676
* @param int $parent_id Category to display rules from; default: 0
77-
* @return rule_interface Added rule entity
77+
* @return \phpbb\boardrules\entity\rule_interface Added rule entity
7878
* @access public
7979
* @throws \phpbb\boardrules\exception\out_of_bounds
8080
*/

tests/text_reparser/rule_text_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace phpbb\boardrules\tests\text_reparser;
1212

13-
include_once dirname(__FILE__) . '/../../../../../../tests/text_reparser/plugins/test_row_based_plugin.php';
13+
include_once __DIR__ . '/../../../../../../tests/text_reparser/plugins/test_row_based_plugin.php';
1414

1515
class rule_text_test extends \phpbb_textreparser_test_row_based_plugin
1616
{

0 commit comments

Comments
 (0)