PluginProbe
Booking Calendar / 11.8.3
Booking Calendar v11.8.3
11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 All 203 releases
← All changes | core/any/class-admin-settings-api.php +37 -2 10.1011.8.3 View file →
@@ -1685,10 +1685,45 @@
1685 1685 */
1686 1686 public function validate_text_post( $post_key ) {
1687 1687 return self::validate_text_post_static( $post_key );
1688 1688 }
1689 -
1690 -
1689 +
1690 + // FixIn: 10.14.2.2
1691 + /**
1692 + * Validate Color: '#ff00ff' in POST request - escape data correctly.
1693 + *
1694 + * @param string $post_key - key for POST
1695 + * @return string | false, if no such POST
1696 + */
1697 + public function validate_color_post( $post_key ) {
1698 + return self::validate_color_static( $post_key );
1699 + }
1700 +
1701 +
1702 + // FixIn: 10.14.2.2
1703 + /**
1704 + * Static Validate Color field in POST request - escape data correctly.
1705 + *
1706 + * @param string $post_key - key for POST
1707 + * @return string | false, if no such POST
1708 + */
1709 + public static function validate_color_static( $post_key ) {
1710 +
1711 + $value = '';
1712 +
1713 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
1714 + if ( isset( $_POST[ $post_key ] ) ) {
1715 + // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
1716 + $value = sanitize_hex_color( trim( stripslashes( $_POST[ $post_key ] ) ) );
1717 + if ( null === $value ) {
1718 + $value = '';
1719 + }
1720 + }
1721 +
1722 + return $value;
1723 + }
1724 +
1725 +
1691 1726 /**
1692 1727 * Static Validate Text in POST request - escape data correctly.
1693 1728 *
1694 1729 * @param string $post_key - key for POST