| @@ -84,8 +84,20 @@ | ||
| 84 | 84 | |
| 85 | 85 | if($attr['constant'] && defined($attr['constant']) && isset($valid_constants[$attr['constant']])) |
| 86 | 86 | { |
| 87 | 87 | $get = constant($attr['constant']); |
| 88 | + | |
| 89 | + //260913.1656 Only format explicitly known timestamp constants, and reject non-string formats before passing them to date(). | |
| 90 | + if(is_string($attr['date_format']) && $attr['date_format'] && is_int($get) && $get > 0 && in_array($attr['constant'], array('S2MEMBER_CURRENT_USER_REGISTRATION_TIME', 'S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME'), true)) | |
| 91 | + { | |
| 92 | + if($attr['date_format'] === 'timestamp') | |
| 93 | + $get = (string)$get; // No change. | |
| 94 | + | |
| 95 | + else if($attr['date_format'] === 'default') | |
| 96 | + $get = date(get_option('date_format'), $get); | |
| 97 | + | |
| 98 | + else $get = date($attr['date_format'], $get); | |
| 99 | + } | |
| 88 | 100 | } |
| 89 | 101 | else if($attr['user_field'] && isset($valid_user_fields[$attr['user_field']])) |
| 90 | 102 | { |
| 91 | 103 | $user_field_args = array('size' => $attr['size']); |