Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use sanitize_html_class() for image classes.

git-svn-id: http://svn.locallylost.com/themes/hybrid-core/trunk@966 dba0f204-706d-4bc1-bc29-8b92e0485636
  • Loading branch information...
commit 2c820a37ad8da814c3157fc311c25009f2900eba 1 parent 1424580
greenshady authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 extensions/get-the-image.php
View
6 extensions/get-the-image.php
@@ -395,12 +395,12 @@ function get_the_image_format( $args = array(), $image = false ) {
/* Loop through the custom field keys and add them as classes. */
if ( is_array( $meta_key ) ) {
foreach ( $meta_key as $key )
- $classes[] = str_replace( ' ', '-', strtolower( $key ) );
+ $classes[] = sanitize_html_class( $key );
}
/* Add the $size and any user-added $image_class to the class. */
- $classes[] = $size;
- $classes[] = $image_class;
+ $classes[] = sanitize_html_class( $size );
+ $classes[] = sanitize_html_class( $image_class );
/* Join all the classes into a single string and make sure there are no duplicates. */
$class = join( ' ', array_unique( $classes ) );
Please sign in to comment.
Something went wrong with that request. Please try again.