File tree Expand file tree Collapse file tree 5 files changed +32
-15
lines changed
Braintree/Controller/Paypal
lib/internal/Magento/Framework/App/Config Expand file tree Collapse file tree 5 files changed +32
-15
lines changed Original file line number Diff line number Diff line change 8
8
namespace Magento \AdminNotification \Block ;
9
9
10
10
/**
11
+ * Admin notification window block
12
+ *
11
13
* @api
12
14
* @since 100.0.2
13
15
*/
Original file line number Diff line number Diff line change 12
12
use Magento \Braintree \Gateway \Config \PayPal \Config ;
13
13
use Magento \Braintree \Model \Paypal \Helper \QuoteUpdater ;
14
14
use Magento \Framework \Exception \LocalizedException ;
15
+ use Magento \Framework \App \Action \HttpPostActionInterface ;
15
16
16
17
/**
17
18
* Class Review
18
19
*/
19
- class Review extends AbstractAction
20
+ class Review extends AbstractAction implements HttpPostActionInterface
20
21
{
21
22
/**
22
23
* @var QuoteUpdater
@@ -91,6 +92,8 @@ public function execute()
91
92
}
92
93
93
94
/**
95
+ * Validate request data
96
+ *
94
97
* @param array $requestData
95
98
* @return boolean
96
99
*/
Original file line number Diff line number Diff line change @@ -113,9 +113,9 @@ public function getFieldsetDataValue($key)
113
113
}
114
114
115
115
/**
116
- * { @inheritdoc}
116
+ * @inheritdoc
117
117
*
118
- * { @inheritdoc} . In addition, it sets status 'invalidate' for config caches
118
+ * @inheritdoc. In addition, it sets status 'invalidate' for config caches
119
119
*
120
120
* @return $this
121
121
*/
@@ -129,9 +129,9 @@ public function afterSave()
129
129
}
130
130
131
131
/**
132
- * { @inheritdoc}
132
+ * @inheritdoc
133
133
*
134
- * { @inheritdoc} . In addition, it sets status 'invalidate' for config caches
134
+ * @inheritdoc. In addition, it sets status 'invalidate' for config caches
135
135
*
136
136
* @return $this
137
137
*/
Original file line number Diff line number Diff line change 9
9
10
10
/**
11
11
* Interface \Magento\Framework\App\Config\ValueInterface
12
- *
13
- * This interface cannot be marked as API since doesn't fit developers' needs of extensibility. In 2.4 we are going
14
- * to introduce a new iterface which should cover all needs and deprecate the this one with the model
12
+ *
13
+ * This interface cannot be marked as API since doesn't fit developers' needs of extensibility. In 2.4 we are going
14
+ * to introduce a new interface which should cover all needs and deprecate the this one with the model
15
15
* {@see \Magento\Framework\App\Config\Value}
16
16
*/
17
17
interface ValueInterface
@@ -23,6 +23,7 @@ interface ValueInterface
23
23
24
24
/**
25
25
* Check if config data value was changed
26
+ *
26
27
* @todo this method should be make as protected
27
28
* @return bool
28
29
*/
Original file line number Diff line number Diff line change @@ -257,13 +257,7 @@ public function getHostUrl()
257
257
/**
258
258
* Define server http host
259
259
*/
260
- if (!empty ($ _SERVER ['HTTP_HOST ' ])) {
261
- $ host = $ _SERVER ['HTTP_HOST ' ];
262
- } elseif (!empty ($ _SERVER ['SERVER_NAME ' ])) {
263
- $ host = $ _SERVER ['SERVER_NAME ' ];
264
- } else {
265
- $ host = 'localhost ' ;
266
- }
260
+ $ host = $ this ->resolveHostName ();
267
261
268
262
$ isSecure = (!empty ($ _SERVER ['HTTPS ' ])) && ($ _SERVER ['HTTPS ' ] !== 'off ' )
269
263
|| isset ($ _SERVER ['HTTP_X_FORWARDED_PROTO ' ]) && ($ _SERVER ['HTTP_X_FORWARDED_PROTO ' ] === 'https ' );
@@ -278,6 +272,23 @@ public function getHostUrl()
278
272
return $ url ;
279
273
}
280
274
275
+ /**
276
+ * Resolve hostname
277
+ *
278
+ * @return string
279
+ */
280
+ private function resolveHostName () : string
281
+ {
282
+ if (!empty ($ _SERVER ['HTTP_HOST ' ])) {
283
+ $ host = $ _SERVER ['HTTP_HOST ' ];
284
+ } elseif (!empty ($ _SERVER ['SERVER_NAME ' ])) {
285
+ $ host = $ _SERVER ['SERVER_NAME ' ];
286
+ } else {
287
+ $ host = 'localhost ' ;
288
+ }
289
+ return $ host ;
290
+ }
291
+
281
292
/**
282
293
* Retrieve base URL
283
294
*
You can’t perform that action at this time.
0 commit comments