Validating CSS values with regex in PHP

Experimental! /** * Regex validation of CSS values for the options. * * @param $subject * * @return bool */ private function css_value_validation( $subject ) { $pattern = ‘(([0-9]{1,})(\.{0,1})([0-9]{0,})(px|pt|pc|em|ex|ch|rem|vh|vw|vmin|vmax|%{0,1})(\s{0,1})){1,4}’; if ( preg_match( $pattern, $subject ) ) { return true; } return false; }

Smart month search

Improve month view search so it is not restricted to the current month. Experimental! Use at own risk, there are known bugs/quirks with this code. If a search is conducted in month view but the relevant events are in a different month, switch to that month.