Skip to content

Commit a592907

Browse files
committed
Use the real class-name argument name, not the shortcode version.
The highlight argument supports values with dashes (range) but no commas. Don't cast those to integers.
1 parent 988dc8b commit a592907

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

syntaxhighlighter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ function shortcode_callback( $atts, $code = '', $tag = false ) {
900900
}
901901

902902
// Sanitize the "classname" parameter
903-
if ( 'classname' == $key )
903+
if ( 'class-name' == $key )
904904
$value = trim( preg_replace( '/[^a-zA-Z0-9 _-]/i', '', $value ) );
905905

906906
// Special sanitization for "pad-line-numbers"
@@ -924,7 +924,7 @@ function shortcode_callback( $atts, $code = '', $tag = false ) {
924924

925925
// Sanitize row highlights
926926
if ( 'highlight' == $key ) {
927-
if ( false === strpos( $value, ',' ) ) {
927+
if ( false === strpos( $value, ',' ) && false === strpos( $value, '-' ) ) {
928928
$value = (int) $value;
929929
} else {
930930
$lines = explode( ',', $value );

0 commit comments

Comments
 (0)