PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.14
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.14
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
← All changes | app/Services/FormBuilder/ShortCodeParser.php +25 -1 6.2.136.2.14 View file →
@@ -10,8 +10,10 @@
10 10 use FluentForm\App\Helpers\Helper;
11 11
12 12 class ShortCodeParser
13 13 {
14 + const USER_SECRET_PROPERTIES = ['user_pass', 'user_activation_key', 'session_tokens', 'data'];
15 +
14 16 protected static $form = null;
15 17
16 18 protected static $entry = null;
17 19
@@ -314,8 +316,11 @@
314 316 'ID', 'id', 'display_name', 'first_name', 'last_name', 'user_email',
315 317 'user_login', 'user_nicename', 'nickname', 'user_url', 'description', 'roles',
316 318 'user_registered', // non-sensitive wp_users column; keep {user.user_registered} working
317 319 ];
320 + if (static::isDeniedUserProperty($key)) {
321 + return '';
322 + }
318 323 if (in_array($key, $allowed, true)) {
319 324 return $user->{$key};
320 325 }
321 326
@@ -340,9 +345,9 @@
340 345
341 346 if (false !== strpos($key, 'author.')) {
342 347 $authorProperty = substr($key, strlen('author.'));
343 348 $authorId = static::$store['post']->post_author;
344 - if ($authorId) {
349 + if ($authorId && !static::isDeniedUserProperty($authorProperty)) {
345 350 $data = get_the_author_meta($authorProperty, $authorId);
346 351 if (!is_array($data)) {
347 352 return $data;
348 353 }
@@ -367,9 +372,28 @@
367 372 return '';
368 373 }
369 374 }
370 375
376 + if ('post_password' === $key) {
377 + return '';
378 + }
379 +
371 380 return static::$store['post']->{$key};
381 + }
382 +
383 + // Shared by {user.*} and {embed_post.author.*} in both parsers. get_the_author_meta() and
384 + // WP_User fall through to any user meta, where plugins keep 2FA secrets and tokens under
385 + // protected (underscore) keys, so the secret columns alone are not enough to deny.
386 + public static function isDeniedUserProperty($property)
387 + {
388 + // Same aliases get_the_author_meta() accepts: 'pass' means user_pass
389 + if (in_array($property, ['login', 'pass', 'nicename', 'email', 'url', 'registered', 'activation_key', 'status'], true)) {
390 + $property = 'user_' . $property;
391 + }
392 +
393 + $denied = (array) apply_filters('fluentform/smartcode_user_denied_properties', self::USER_SECRET_PROPERTIES);
394 +
395 + return in_array($property, $denied, true) || is_protected_meta($property, 'user');
372 396 }
373 397
374 398 protected static function getWPData($key)
375 399 {