PluginProbe
Patchstack – WordPress & Plugins Security / 2.2.5
Patchstack – WordPress & Plugins Security v2.2.5
2.3.7 trunk 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.2 2.1.20 2.1.21 2.1.22 2.1.23 2.1.24 2.1.25 2.1.3 2.1.4 2.1.5 2.1.6 All 49 releases
← All changes | lib/patchstack/src/Response.php +47 -47 trunk2.2.5 View file →
@@ -1,47 +1,47 @@
1 -<?php
2 -
3 -namespace Patchstack;
4 -
5 -class Response
6 -{
7 - /**
8 - * The options of the engine.
9 - *
10 - * @var array
11 - */
12 - private $options;
13 -
14 - /**
15 - * Creates a new request instance.
16 - *
17 - * @param array $options
18 - * @return void
19 - */
20 - public function __construct($options = [])
21 - {
22 - $this->options = $options;
23 - }
24 -
25 - /**
26 - * Perform a redirect if the request must be redirected to somewhere else.
27 - *
28 - * @param string $redirectTo
29 - * @param boolean $mustExit
30 - * @return void
31 - */
32 - public function redirect($redirectTo = '', $mustExit = true)
33 - {
34 - // Don't redirect an invalid URL.
35 - if (!$redirectTo || filter_var($redirectTo, FILTER_VALIDATE_URL) === false) {
36 - return false;
37 - }
38 -
39 - // Perform the redirect.
40 - header('Location: ' . $redirectTo, true, 302);
41 -
42 - // In some scenarios we might want to control if the script should exit executing.
43 - if ($mustExit) {
44 - exit;
45 - }
46 - }
47 -}
1 +<?php
2 +
3 +namespace Patchstack;
4 +
5 +class Response
6 +{
7 + /**
8 + * The options of the engine.
9 + *
10 + * @var array
11 + */
12 + private $options;
13 +
14 + /**
15 + * Creates a new request instance.
16 + *
17 + * @param array $options
18 + * @return void
19 + */
20 + public function __construct($options = [])
21 + {
22 + $this->options = $options;
23 + }
24 +
25 + /**
26 + * Perform a redirect if the request must be redirected to somewhere else.
27 + *
28 + * @param string $redirectTo
29 + * @param boolean $mustExit
30 + * @return void
31 + */
32 + public function redirect($redirectTo = '', $mustExit = true)
33 + {
34 + // Don't redirect an invalid URL.
35 + if (!$redirectTo || filter_var($redirectTo, FILTER_VALIDATE_URL) === false) {
36 + return false;
37 + }
38 +
39 + // Perform the redirect.
40 + header('Location: ' . $redirectTo, true, 302);
41 +
42 + // In some scenarios we might want to control if the script should exit executing.
43 + if ($mustExit) {
44 + exit;
45 + }
46 + }
47 +}