Skip to content
Permalink
Browse files

Fixed security vulnerability with custom stylesheets

  • Loading branch information...
Boonstra committed Apr 23, 2015
1 parent 8324b88 commit cac505e593cbe70a4d8af5b639f5385d4cc7aa04
Showing with 12 additions and 5 deletions.
  1. +10 −4 classes/SlideshowPluginSlideshowStylesheet.php
  2. +2 −1 readme.txt
@@ -187,10 +187,16 @@ public static function loadStylesheetByAJAX()
*/
public static function getStylesheet($styleName)
{
// Get custom stylesheet, of the default stylesheet if the custom stylesheet does not exist
$stylesheet = get_option($styleName, '');
// Get custom style keys
$customStyleKeys = array_keys(get_option(SlideshowPluginGeneralSettings::$customStyles, array()));
if (strlen($stylesheet) <= 0)
// Match $styleName against custom style keys
if (in_array($styleName, $customStyleKeys))
{
// Get custom stylesheet
$stylesheet = get_option($styleName, '');
}
else
{
$stylesheetFile = SlideshowPluginMain::getPluginPath() . DIRECTORY_SEPARATOR . 'style' . DIRECTORY_SEPARATOR . 'SlideshowPlugin' . DIRECTORY_SEPARATOR . $styleName . '.css';
@@ -202,7 +208,7 @@ public static function getStylesheet($styleName)
// Get contents of stylesheet
ob_start();
include($stylesheetFile);
$stylesheet .= ob_get_clean();
$stylesheet = ob_get_clean();
}
// Replace the URL placeholders with actual URLs and add a unique identifier to separate stylesheets
@@ -182,8 +182,9 @@ personal taste.
== Changelog ==

= 2.2.22 =
* Compatible with WordPress 4.0.
* Compatible with WordPress 4.2.
* Default stylesheets are no longer dynamically loaded through admin-ajax.php.
* Fixed: Security vulnerability in the SlideshowPluginSlideshowStylesheet class.
* Fixed: An issue with admin-ajax.php when the frontend uses HTTP, while the backend uses HTTPS. Thanks to [Chris Scott](https://github.com/chrisscott)
* Fixed: A bug that caused the previous slide button and the navigation bullets to malfunction on "Cross Fade" setting.
* Fixed: Slideshow container calculation now uses the JavaScript round function instead of the floor function.

0 comments on commit cac505e

Please sign in to comment.
You can’t perform that action at this time.