- Timestamp:
- 06/18/2022 11:33:53 PM (4 years ago)
- Location:
- anrghg
- Files:
-
- 6 edited
- 1 copied
-
tags/0.81.6 (copied) (copied from anrghg/trunk)
-
tags/0.81.6/anrghg.php (modified) (7 diffs)
-
tags/0.81.6/package.json (modified) (1 diff)
-
tags/0.81.6/readme.txt (modified) (2 diffs)
-
trunk/anrghg.php (modified) (7 diffs)
-
trunk/package.json (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
anrghg/tags/0.81.6/anrghg.php
r2744607 r2744639 14 14 * Tested PHP up to: 8.0 15 15 * CAUTION: The following field is parsed in the stable tag folder for upgrade configuration: 16 * Version: 0.81. 516 * Version: 0.81.6 17 17 * Author: ANRGHG 18 18 * Author URI: https://anrghg.sunsite.fr … … 79 79 * @var string C_S_ANRGHG_VER Plugin version constant. 80 80 */ 81 define( 'C_S_ANRGHG_VER', '0.81. 5' );81 define( 'C_S_ANRGHG_VER', '0.81.6' ); 82 82 83 83 /** … … 1074 1074 1075 1075 /** 1076 * Generates thewhitelist for `wp_kses()`.1076 * Generates a global whitelist for `wp_kses()`. 1077 1077 * 1078 1078 * @since 0.81.5 1079 * User input is supported by $allowedposttags and $allowedtags. 1079 * @since 0.81.6 Fix bug in whitelist extension. 1080 * @since 0.81.6 Tailor whitelists to the instance for more efficiency. 1081 * Global KSES whitelists are a non-starter, because they defeat the 1082 * KSES design goals, e.g. the button[onclick] should not be allowed 1083 * on public pages. But the input[checked,class,id,type] is required 1084 * on public pages to support display toggle checkboxes. WordPress’s 1085 * implementation of global attributes is lacking the [tabindex] and 1086 * most [aria-*] attributes. Thus, KSES + WordPress is bad for a11y. 1087 * Therefore our KSES whitelists should be tailored to the instance. 1088 * 1089 * User input may be supported by $allowedposttags. 1080 1090 * @see wp-includes/kses.php 1081 1091 * @see also the `$global_attributes` in `wp-includes/kses.php:2520`. … … 1083 1093 * `wp_kses()` escapes `>` (and `<`) as HTML entities. 1084 1094 * 1085 * BUG REPORT: After the tabindex argument is properly added to div,1086 * the input and meta elements are not added.1087 * With array_push() instead of [], the function breaks down.1088 * 1095 * global $allowedtags provided along with $allowedposttags is a very 1096 * limited subset of the latter, so merging it in would be pointless. 1097 * @global $allowedposttags WordPress KSES whitelist. 1098 * @global $g_m_anrghg_whitelist Extended KSES whitelist. 1089 1099 * @return array $g_m_anrghg_whitelist 1090 1100 */ 1091 1101 function anrghg_whitelist() { 1092 global $allowedposttags, $ allowedtags, $g_m_anrghg_whitelist;1102 global $allowedposttags, $g_m_anrghg_whitelist; 1093 1103 if ( false === $g_m_anrghg_whitelist ) { 1094 1104 $g_m_anrghg_whitelist = $allowedposttags; 1095 foreach ( $allowedtags as $l_s_name => $l_m_val ) {1096 if ( array_key_exists( $l_s_name, $g_m_anrghg_whitelist ) ) {1097 $g_m_anrghg_whitelist[ $l_s_name ] = array_merge( $g_m_anrghg_whitelist[ $l_s_name ], $allowedtags[ $l_s_name ] );1098 } else {1099 $g_m_anrghg_whitelist[] = $allowedtags[ $l_s_name ];1100 }1101 }1102 1105 $l_a_whitelist = array( 1103 1106 'a' => array( 1104 'class' => true,1105 'href' => true,1106 1107 'tabindex' => true, 1107 1108 ), 1108 'br' => array(),1109 'button' => array(1110 'class' => true,1111 'id' => true,1112 'name' => true,1113 'onclick' => true,1114 'type' => true,1115 ),1116 'code' => array(1117 'class' => true,1118 ),1119 'datalist' => array(1120 'id' => true,1121 ),1122 1109 'div' => array( 1123 'aria-hidden' => true,1124 'autofocus' => true,1125 'class' => true,1126 'contenteditable' => true,1127 'hidden' => true,1128 'id' => true,1129 1110 'tabindex' => true, 1130 1111 ), 1131 'fieldset' => array(),1132 1112 'input' => array( 1133 'aria-label' => true,1134 1113 'checked' => true, 1135 1114 'class' => true, 1136 1115 'id' => true, 1137 'name' => true,1138 'min' => true,1139 'max' => true,1140 'step' => true,1141 'list' => true,1142 'onkeyup' => true,1143 'placeholder' => true,1144 1116 'type' => true, 1145 'value' => true,1146 1117 ), 1147 1118 'label' => array( 1148 1119 'class' => true, 1149 1120 'for' => true, 1150 ),1151 'legend' => array(1152 'aria-hidden' => true,1153 'aria-label' => true,1154 'class' => true,1155 ),1156 'li' => array(1157 'class' => true,1158 ),1159 'meta' => array(1160 'content' => true,1161 'name' => true,1162 'property' => true,1163 ),1164 'option' => array(1165 'aria-label' => true,1166 'selected' => true,1167 'value' => true,1168 ),1169 'optgroup' => array(1170 'label' => true,1171 ),1172 'p' => array(1173 'class' => true,1174 ),1175 'select' => array(1176 'id' => true,1177 'name' => true,1178 ),1179 'span' => array(1180 'class' => true,1181 'id' => true,1182 ),1183 'table' => array(1184 'class' => true,1185 ),1186 'tbody' => array(),1187 'td' => array(),1188 'textarea' => array(1189 'class' => true,1190 'id' => true,1191 'name' => true,1192 'placeholder' => true,1193 ),1194 'tr' => array(1195 'id' => true,1196 ),1197 'ul' => array(1198 'class' => true,1199 1121 ), 1200 1122 ); … … 1203 1125 $g_m_anrghg_whitelist[ $l_s_name ] = array_merge( $g_m_anrghg_whitelist[ $l_s_name ], $l_a_whitelist[ $l_s_name ] ); 1204 1126 } else { 1205 $g_m_anrghg_whitelist[ ] = $l_a_whitelist[ $l_s_name ];1127 $g_m_anrghg_whitelist[ $l_s_name ] = $l_a_whitelist[ $l_s_name ]; 1206 1128 } 1207 1129 } … … 3188 3110 function anrghg_add_date_meta_tags() { 3189 3111 if ( anrghg_apply_config( 'anrghg_date_meta_common_published' ) ) { 3190 echo ( 3191 "\t<meta name=\"date\" content=\"" . get_the_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n" 3112 echo wp_kses( 3113 "\t<meta name=\"date\" content=\"" . get_the_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n", 3114 array( 'meta' => array( 'name' => true, 'content' => true ) ) 3192 3115 ); 3193 3116 } 3194 3117 if ( anrghg_apply_config( 'anrghg_date_meta_common_last_edit' ) ) { 3195 anrghg_kses_echo( 3196 "\t<meta name=\"last-modified\" content=\"" . get_the_modified_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n" 3118 echo wp_kses( 3119 "\t<meta name=\"last-modified\" content=\"" . get_the_modified_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n", 3120 array( 'meta' => array( 'name' => true, 'content' => true ) ) 3197 3121 ); 3198 3122 } 3199 3123 if ( anrghg_apply_config( 'anrghg_date_meta_open_g_published' ) ) { 3200 anrghg_kses_echo( 3201 "\t<meta property=\"article:published_time\" content=\"" . get_the_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n" 3124 echo wp_kses( 3125 "\t<meta property=\"article:published_time\" content=\"" . get_the_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n", 3126 array( 'meta' => array( 'property' => true, 'content' => true ) ) 3202 3127 ); 3203 3128 } 3204 3129 if ( anrghg_apply_config( 'anrghg_date_meta_open_g_last_edit' ) ) { 3205 anrghg_kses_echo( 3206 "\t<meta property=\"article:modified_time\" content=\"" . get_the_modified_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n" 3130 echo wp_kses( 3131 "\t<meta property=\"article:modified_time\" content=\"" . get_the_modified_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n", 3132 array( 'meta' => array( 'property' => true, 'content' => true ) ) 3207 3133 ); 3208 3134 } … … 5384 5310 'wp_footer', 5385 5311 function() { 5386 global $g_s_anrghg_footer ;5312 global $g_s_anrghg_footer, $g_m_anrghg_whitelist; 5387 5313 if ( ! empty( $g_s_anrghg_footer ) ) { 5388 5314 anrghg_kses_echo( "\r\n\r\n" . '<div class="anrghg-footer-complement-list">' ); -
anrghg/tags/0.81.6/package.json
r2744607 r2744639 1 1 { 2 2 "name": "anrghg", 3 "version": "0.81. 5",3 "version": "0.81.6", 4 4 "description": "A.N.R.GHG Publishing Helper", 5 5 "main": "index.js", -
anrghg/tags/0.81.6/readme.txt
r2744607 r2744639 8 8 Requires PHP: 5.6 9 9 Tested PHP up to: 8.0 10 Package Version: 0.81. 5.011 Version: 0.81. 510 Package Version: 0.81.6.0 11 Version: 0.81.6 12 12 CAUTION: The following field is parsed in trunk/ for release configuration: 13 Stable Tag: 0.81. 513 Stable Tag: 0.81.6 14 14 License: GPLv2 or later 15 15 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 502 502 == Changelog == 503 503 504 = 0.81.6 (2022-06-18) = 505 506 * Security: KSES whitelist: Fix bug in whitelist extension. 507 * Security: Stop trying to use a global KSES whitelist. 508 * Security: Date meta tags: Tailor KSES whitelists to the instance. 509 504 510 = 0.81.5 (2022-06-18) = 505 511 506 512 * Security: Internal style sheets: Secure output. 507 513 * Security: Internal style sheets: Restore direct child selectors. 508 * Security: KSES: Properly implement the whitelist with extensions. 509 * Security: KSES: Document unfixable bug in implementation. 514 * Security: KSES: Try implementing the whitelist with extensions. 510 515 511 516 = 0.81.4 (2022-06-17) = -
anrghg/trunk/anrghg.php
r2744607 r2744639 14 14 * Tested PHP up to: 8.0 15 15 * CAUTION: The following field is parsed in the stable tag folder for upgrade configuration: 16 * Version: 0.81. 516 * Version: 0.81.6 17 17 * Author: ANRGHG 18 18 * Author URI: https://anrghg.sunsite.fr … … 79 79 * @var string C_S_ANRGHG_VER Plugin version constant. 80 80 */ 81 define( 'C_S_ANRGHG_VER', '0.81. 5' );81 define( 'C_S_ANRGHG_VER', '0.81.6' ); 82 82 83 83 /** … … 1074 1074 1075 1075 /** 1076 * Generates thewhitelist for `wp_kses()`.1076 * Generates a global whitelist for `wp_kses()`. 1077 1077 * 1078 1078 * @since 0.81.5 1079 * User input is supported by $allowedposttags and $allowedtags. 1079 * @since 0.81.6 Fix bug in whitelist extension. 1080 * @since 0.81.6 Tailor whitelists to the instance for more efficiency. 1081 * Global KSES whitelists are a non-starter, because they defeat the 1082 * KSES design goals, e.g. the button[onclick] should not be allowed 1083 * on public pages. But the input[checked,class,id,type] is required 1084 * on public pages to support display toggle checkboxes. WordPress’s 1085 * implementation of global attributes is lacking the [tabindex] and 1086 * most [aria-*] attributes. Thus, KSES + WordPress is bad for a11y. 1087 * Therefore our KSES whitelists should be tailored to the instance. 1088 * 1089 * User input may be supported by $allowedposttags. 1080 1090 * @see wp-includes/kses.php 1081 1091 * @see also the `$global_attributes` in `wp-includes/kses.php:2520`. … … 1083 1093 * `wp_kses()` escapes `>` (and `<`) as HTML entities. 1084 1094 * 1085 * BUG REPORT: After the tabindex argument is properly added to div,1086 * the input and meta elements are not added.1087 * With array_push() instead of [], the function breaks down.1088 * 1095 * global $allowedtags provided along with $allowedposttags is a very 1096 * limited subset of the latter, so merging it in would be pointless. 1097 * @global $allowedposttags WordPress KSES whitelist. 1098 * @global $g_m_anrghg_whitelist Extended KSES whitelist. 1089 1099 * @return array $g_m_anrghg_whitelist 1090 1100 */ 1091 1101 function anrghg_whitelist() { 1092 global $allowedposttags, $ allowedtags, $g_m_anrghg_whitelist;1102 global $allowedposttags, $g_m_anrghg_whitelist; 1093 1103 if ( false === $g_m_anrghg_whitelist ) { 1094 1104 $g_m_anrghg_whitelist = $allowedposttags; 1095 foreach ( $allowedtags as $l_s_name => $l_m_val ) {1096 if ( array_key_exists( $l_s_name, $g_m_anrghg_whitelist ) ) {1097 $g_m_anrghg_whitelist[ $l_s_name ] = array_merge( $g_m_anrghg_whitelist[ $l_s_name ], $allowedtags[ $l_s_name ] );1098 } else {1099 $g_m_anrghg_whitelist[] = $allowedtags[ $l_s_name ];1100 }1101 }1102 1105 $l_a_whitelist = array( 1103 1106 'a' => array( 1104 'class' => true,1105 'href' => true,1106 1107 'tabindex' => true, 1107 1108 ), 1108 'br' => array(),1109 'button' => array(1110 'class' => true,1111 'id' => true,1112 'name' => true,1113 'onclick' => true,1114 'type' => true,1115 ),1116 'code' => array(1117 'class' => true,1118 ),1119 'datalist' => array(1120 'id' => true,1121 ),1122 1109 'div' => array( 1123 'aria-hidden' => true,1124 'autofocus' => true,1125 'class' => true,1126 'contenteditable' => true,1127 'hidden' => true,1128 'id' => true,1129 1110 'tabindex' => true, 1130 1111 ), 1131 'fieldset' => array(),1132 1112 'input' => array( 1133 'aria-label' => true,1134 1113 'checked' => true, 1135 1114 'class' => true, 1136 1115 'id' => true, 1137 'name' => true,1138 'min' => true,1139 'max' => true,1140 'step' => true,1141 'list' => true,1142 'onkeyup' => true,1143 'placeholder' => true,1144 1116 'type' => true, 1145 'value' => true,1146 1117 ), 1147 1118 'label' => array( 1148 1119 'class' => true, 1149 1120 'for' => true, 1150 ),1151 'legend' => array(1152 'aria-hidden' => true,1153 'aria-label' => true,1154 'class' => true,1155 ),1156 'li' => array(1157 'class' => true,1158 ),1159 'meta' => array(1160 'content' => true,1161 'name' => true,1162 'property' => true,1163 ),1164 'option' => array(1165 'aria-label' => true,1166 'selected' => true,1167 'value' => true,1168 ),1169 'optgroup' => array(1170 'label' => true,1171 ),1172 'p' => array(1173 'class' => true,1174 ),1175 'select' => array(1176 'id' => true,1177 'name' => true,1178 ),1179 'span' => array(1180 'class' => true,1181 'id' => true,1182 ),1183 'table' => array(1184 'class' => true,1185 ),1186 'tbody' => array(),1187 'td' => array(),1188 'textarea' => array(1189 'class' => true,1190 'id' => true,1191 'name' => true,1192 'placeholder' => true,1193 ),1194 'tr' => array(1195 'id' => true,1196 ),1197 'ul' => array(1198 'class' => true,1199 1121 ), 1200 1122 ); … … 1203 1125 $g_m_anrghg_whitelist[ $l_s_name ] = array_merge( $g_m_anrghg_whitelist[ $l_s_name ], $l_a_whitelist[ $l_s_name ] ); 1204 1126 } else { 1205 $g_m_anrghg_whitelist[ ] = $l_a_whitelist[ $l_s_name ];1127 $g_m_anrghg_whitelist[ $l_s_name ] = $l_a_whitelist[ $l_s_name ]; 1206 1128 } 1207 1129 } … … 3188 3110 function anrghg_add_date_meta_tags() { 3189 3111 if ( anrghg_apply_config( 'anrghg_date_meta_common_published' ) ) { 3190 echo ( 3191 "\t<meta name=\"date\" content=\"" . get_the_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n" 3112 echo wp_kses( 3113 "\t<meta name=\"date\" content=\"" . get_the_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n", 3114 array( 'meta' => array( 'name' => true, 'content' => true ) ) 3192 3115 ); 3193 3116 } 3194 3117 if ( anrghg_apply_config( 'anrghg_date_meta_common_last_edit' ) ) { 3195 anrghg_kses_echo( 3196 "\t<meta name=\"last-modified\" content=\"" . get_the_modified_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n" 3118 echo wp_kses( 3119 "\t<meta name=\"last-modified\" content=\"" . get_the_modified_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n", 3120 array( 'meta' => array( 'name' => true, 'content' => true ) ) 3197 3121 ); 3198 3122 } 3199 3123 if ( anrghg_apply_config( 'anrghg_date_meta_open_g_published' ) ) { 3200 anrghg_kses_echo( 3201 "\t<meta property=\"article:published_time\" content=\"" . get_the_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n" 3124 echo wp_kses( 3125 "\t<meta property=\"article:published_time\" content=\"" . get_the_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n", 3126 array( 'meta' => array( 'property' => true, 'content' => true ) ) 3202 3127 ); 3203 3128 } 3204 3129 if ( anrghg_apply_config( 'anrghg_date_meta_open_g_last_edit' ) ) { 3205 anrghg_kses_echo( 3206 "\t<meta property=\"article:modified_time\" content=\"" . get_the_modified_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n" 3130 echo wp_kses( 3131 "\t<meta property=\"article:modified_time\" content=\"" . get_the_modified_date( 'Y-m-d\TH:i:sO' ) . "\" />\r\n", 3132 array( 'meta' => array( 'property' => true, 'content' => true ) ) 3207 3133 ); 3208 3134 } … … 5384 5310 'wp_footer', 5385 5311 function() { 5386 global $g_s_anrghg_footer ;5312 global $g_s_anrghg_footer, $g_m_anrghg_whitelist; 5387 5313 if ( ! empty( $g_s_anrghg_footer ) ) { 5388 5314 anrghg_kses_echo( "\r\n\r\n" . '<div class="anrghg-footer-complement-list">' ); -
anrghg/trunk/package.json
r2744607 r2744639 1 1 { 2 2 "name": "anrghg", 3 "version": "0.81. 5",3 "version": "0.81.6", 4 4 "description": "A.N.R.GHG Publishing Helper", 5 5 "main": "index.js", -
anrghg/trunk/readme.txt
r2744607 r2744639 8 8 Requires PHP: 5.6 9 9 Tested PHP up to: 8.0 10 Package Version: 0.81. 5.011 Version: 0.81. 510 Package Version: 0.81.6.0 11 Version: 0.81.6 12 12 CAUTION: The following field is parsed in trunk/ for release configuration: 13 Stable Tag: 0.81. 513 Stable Tag: 0.81.6 14 14 License: GPLv2 or later 15 15 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 502 502 == Changelog == 503 503 504 = 0.81.6 (2022-06-18) = 505 506 * Security: KSES whitelist: Fix bug in whitelist extension. 507 * Security: Stop trying to use a global KSES whitelist. 508 * Security: Date meta tags: Tailor KSES whitelists to the instance. 509 504 510 = 0.81.5 (2022-06-18) = 505 511 506 512 * Security: Internal style sheets: Secure output. 507 513 * Security: Internal style sheets: Restore direct child selectors. 508 * Security: KSES: Properly implement the whitelist with extensions. 509 * Security: KSES: Document unfixable bug in implementation. 514 * Security: KSES: Try implementing the whitelist with extensions. 510 515 511 516 = 0.81.4 (2022-06-17) =
Note: See TracChangeset
for help on using the changeset viewer.