← All changes
|
src/includes/externals/aweber/oauth_application.php
+9
-1
260805
→
260927
View file →
| @@ -54,8 +54,10 @@ | ||
| 54 | 54 | * |
| 55 | 55 | * @package |
| 56 | 56 | * @version $id$ |
| 57 | 57 | */ |
| 58 | +//260816 This legacy OAuth client intentionally uses dynamic state properties; opt in explicitly on PHP 8.2+. | |
| 59 | +#[\AllowDynamicProperties] | |
| 58 | 60 | class OAuthApplication implements AWeberOAuthAdapter { |
| 59 | 61 | public $debug = false; |
| 60 | 62 | |
| 61 | 63 | public $userAgent = 'AWeber OAuth Consumer Application 1.0 - https://labs.aweber.com/'; |
| @@ -310,9 +312,15 @@ | ||
| 310 | 312 | * @access protected |
| 311 | 313 | * @return void Encoded data |
| 312 | 314 | */ |
| 313 | 315 | protected function encode($data) { |
| 314 | - return rawurlencode(utf8_encode($data)); | |
| 316 | + //260816 Avoid utf8_encode() deprecations on PHP 8.2+ while preserving older fallbacks where possible. | |
| 317 | + if (function_exists('mb_convert_encoding')) { | |
| 318 | + $data = mb_convert_encoding($data, 'UTF-8', 'ISO-8859-1'); | |
| 319 | + } elseif (function_exists('iconv')) { | |
| 320 | + $data = iconv('ISO-8859-1', 'UTF-8', $data); | |
| 321 | + } | |
| 322 | + return rawurlencode($data); | |
| 315 | 323 | } |
| 316 | 324 | |
| 317 | 325 | /** |
| 318 | 326 | * createSignatureKey |