Skip to content

Commit 14f8d8a

Browse files
committed
Properly cast two settings to an integer. Props Alexander Concha (@xknown).
1 parent acce1ce commit 14f8d8a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

syntaxhighlighter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Plugin Name: SyntaxHighlighter Evolved
66
Plugin URI: http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/
7-
Version: 3.1.12
7+
Version: 3.1.13
88
Description: Easily post syntax-highlighted code to your site without having to modify the code at all. Uses Alex Gorbatchev's <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">SyntaxHighlighter</a>. <strong>TIP:</strong> Don't use the Visual editor if you don't want your code mangled. TinyMCE will "clean up" your HTML.
99
Author: Alex Mills (Viper007Bond)
1010
Author URI: http://www.viper007bond.com/
@@ -21,7 +21,7 @@
2121

2222
class SyntaxHighlighter {
2323
// All of these variables are private. Filters are provided for things that can be modified.
24-
var $pluginver = '3.1.12'; // Plugin version
24+
var $pluginver = '3.1.13'; // Plugin version
2525
var $agshver = false; // Alex Gorbatchev's SyntaxHighlighter version (dynamically set below due to v2 vs v3)
2626
var $shfolder = false; // Controls what subfolder to load SyntaxHighlighter from (v2 or v3)
2727
var $settings = array(); // Contains the user's settings
@@ -1238,8 +1238,8 @@ function validate_settings( $settings ) {
12381238
$settings['padlinenumbers'] = (int) $settings['padlinenumbers'];
12391239

12401240
$settings['classname'] = ( !empty($settings['classname']) ) ? preg_replace( '/[^ A-Za-z0-9_-]*/', '', $settings['classname'] ) : '';
1241-
$settings['firstline'] = (int) ( !empty($settings['firstline']) ) ? $settings['firstline'] : $this->defaultsettings['firstline'];
1242-
$settings['tabsize'] = (int) ( !empty($settings['tabsize']) ) ? $settings['tabsize'] : $this->defaultsettings['tabsize'];
1241+
$settings['firstline'] = (int) ( ( !empty($settings['firstline']) ) ? $settings['firstline'] : $this->defaultsettings['firstline'] );
1242+
$settings['tabsize'] = (int) ( ( !empty($settings['tabsize']) ) ? $settings['tabsize'] : $this->defaultsettings['tabsize'] );
12431243
}
12441244

12451245
return $settings;

0 commit comments

Comments
 (0)