PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.4.0
Fluent Support – Helpdesk & Customer Support Ticket System v2.4.0
2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 All 68 releases
← All changes | app/Models/Model.php +20 -1 1.5.22.4.0 View file →
@@ -7,9 +7,28 @@
7 7 class Model extends BaseModel
8 8 {
9 9 protected $guarded = ['id', 'ID'];
10 10
11 + public function __construct($attributes = [])
12 + {
13 + parent::__construct($attributes);
14 + }
15 +
11 16 public function getPerPage()
12 17 {
13 - return (isset($_REQUEST['per_page'])) ? intval($_REQUEST['per_page']) : 15;
18 + if (!isset($_REQUEST['per_page'])) {
19 + return 15;
20 + }
21 +
22 + if (isset($_REQUEST['nonce'])) {
23 + $nonceAction = (defined('REST_REQUEST') && REST_REQUEST) ? 'wp_rest' : 'fluent-support';
24 +
25 + if (!wp_verify_nonce(sanitize_text_field(wp_unslash($_REQUEST['nonce'])), $nonceAction)) {
26 + return 15;
27 + }
28 + } elseif (is_admin() || wp_doing_ajax() || (defined('REST_REQUEST') && REST_REQUEST)) {
29 + return intval(sanitize_text_field(wp_unslash($_REQUEST['per_page']))) ?? 15;
30 + }
31 +
32 + return intval(sanitize_text_field(wp_unslash($_REQUEST['per_page'])));
14 33 }
15 34 }