Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/seraphinite-accelerator/Cmn/Gen.php
+++ b/seraphinite-accelerator/Cmn/Gen.php
@@ -4068,7 +4068,7 @@
if( !isset( $args[ 'provider' ] ) )
$args[ 'provider' ] = 'CURL';
if( !isset( $args[ 'user-agent' ] ) )
- $args[ 'user-agent' ] = 'seraph-accel-Agent/2.31';
+ $args[ 'user-agent' ] = 'seraph-accel-Agent/2.31.1';
if( !isset( $args[ 'timeout' ] ) )
$args[ 'timeout' ] = 5;
--- a/seraphinite-accelerator/Cmn/Plugin.php
+++ b/seraphinite-accelerator/Cmn/Plugin.php
@@ -316,7 +316,7 @@
$args[ 'epid' ] = Wp::GetSiteId();
$args[ 'id' ] = 'wordpress-accelerator';
$args[ 'name' ] = 'Accelerator';
- $args[ 'v' ] = '2.31';
+ $args[ 'v' ] = '2.31.1';
$args[ 'pk' ] = 'Base';
$args[ 'cfg' ] = '';
$args[ 'loc' ] = Wp::GetLocale();
@@ -338,11 +338,11 @@
if( $lastCheckPackage === null && $lastCheckVer !== null )
$lastCheckPackage = 'Base';
- if( $lastCheckVer !== '2.31' || $lastCheckPackage !== 'Base' )
+ if( $lastCheckVer !== '2.31.1' || $lastCheckPackage !== 'Base' )
{
$state = Plugin::StateGet();
- if( $lastCheckVer !== '2.31' && !isset( $state[ 'changeVerCheck' ] ) )
+ if( $lastCheckVer !== '2.31.1' && !isset( $state[ 'changeVerCheck' ] ) )
{
$state[ 'changeVerCheck' ] = $lastCheckVer !== null ? $lastCheckVer : '';
Plugin::StateSet( $state );
@@ -359,7 +359,7 @@
if( !$bForce )
{
- if( $bFirstTimeOnly && $lastCheckVer == '2.31' )
+ if( $bFirstTimeOnly && $lastCheckVer == '2.31.1' )
return( Gen::S_FALSE );
$lastUpdTime = ($data[ 'updTime' ]??null);
@@ -378,7 +378,7 @@
$args[ 'epid' ] = Wp::GetSiteId();
$args[ 'id' ] = 'wordpress-accelerator';
$args[ 'name' ] = 'Accelerator';
- $args[ 'v' ] = '2.31';
+ $args[ 'v' ] = '2.31.1';
$args[ 'pk' ] = 'Base';
$args[ 'cfg' ] = '';
$args[ 'loc' ] = Wp::GetLocale();
@@ -395,7 +395,7 @@
if( $data[ 'mdfTime' ] >= $timeMdf )
{
$data[ 'updTime' ] = $curUpdTime;
- $data[ 'plgVer' ] = '2.31';
+ $data[ 'plgVer' ] = '2.31.1';
$data[ 'plgPk' ] = 'Base';
$hr = PluginOptions::Set( self::STG_VER, self::STG_ID, $data, __CLASS__ . '::' );
@@ -412,7 +412,7 @@
$data[ 'mdfTime' ] = $timeMdf;
$data[ 'updTime' ] = $curUpdTime;
- $data[ 'plgVer' ] = '2.31';
+ $data[ 'plgVer' ] = '2.31.1';
$data[ 'plgPk' ] = 'Base';
if( $timeMdf )
@@ -1564,10 +1564,10 @@
$rmtCfg = PluginRmtCfg::Get();
$urlProductInfo = Plugin::RmtCfgFld_GetLoc( $rmtCfg, 'Links.UrlProductInfo' );
- $urlAboutPluginImg = file_exists( __DIR__ . '/../Images/ProductLogo.png' ) ? add_query_arg( array( 'v' => '2.31' ), Plugin::FileUri( '../Images/ProductLogo.png', __FILE__ ) ) : null;
+ $urlAboutPluginImg = file_exists( __DIR__ . '/../Images/ProductLogo.png' ) ? add_query_arg( array( 'v' => '2.31.1' ), Plugin::FileUri( '../Images/ProductLogo.png', __FILE__ ) ) : null;
$urlAboutPluginDocs = Plugin::RmtCfgFld_GetLoc( $rmtCfg, 'Links.UrlProductDocs' );
$urlAboutPluginSupport = Plugin::RmtCfgFld_GetLoc( $rmtCfg, 'Links.UrlProductSupport' );
- $url3rdPartySoft = file_exists( __DIR__ . '/../third-party-software.html' ) ? add_query_arg( array( 'v' => '2.31' ), Plugin::FileUri( '../third-party-software.html', __FILE__ ) ) : null;
+ $url3rdPartySoft = file_exists( __DIR__ . '/../third-party-software.html' ) ? add_query_arg( array( 'v' => '2.31.1' ), Plugin::FileUri( '../third-party-software.html', __FILE__ ) ) : null;
$urlEula = null;
@@ -1576,7 +1576,7 @@
$res .= Ui::Tag( 'p' );
{
- $version = esc_html( '2.31' );
+ $version = esc_html( '2.31.1' );
$res .= Ui::TagOpen( 'div' );
@@ -1625,7 +1625,7 @@
{
$rmtCfg = PluginRmtCfg::Get();
- $urlAboutUsLogoImg = file_exists( __DIR__ . '/../Images/VendorLogo.png' ) ? add_query_arg( array( 'v' => '2.31' ), Plugin::FileUri( '../Images/VendorLogo.png', __FILE__ ) ) : null;
+ $urlAboutUsLogoImg = file_exists( __DIR__ . '/../Images/VendorLogo.png' ) ? add_query_arg( array( 'v' => '2.31.1' ), Plugin::FileUri( '../Images/VendorLogo.png', __FILE__ ) ) : null;
$urlMorePlugins = Plugin::RmtCfgFld_GetLoc( $rmtCfg, 'Links.UrlMorePlugins' );
$urlMoreInfo = Plugin::RmtCfgFld_GetLoc( $rmtCfg, 'Links.UrlMain' );
@@ -2154,7 +2154,7 @@
return( null );
$verFrom = self::_PrevVer_GetInt( $plgVerPrev );
- $verTo = self::_PrevVer_GetInt( '2.31' );
+ $verTo = self::_PrevVer_GetInt( '2.31.1' );
if( $verTo < $verFrom )
list( $verTo, $verFrom ) = array( $verFrom, $verTo );
@@ -2279,7 +2279,7 @@
if( (self::$g_aAlreadyIncludedObj[ 'css' ][ $id ]??null) )
continue;
- wp_enqueue_style( Plugin::CmnScriptId( $id ), add_query_arg( Plugin::GetFileUrlPackageParams(), $fileUrl . '/' . $id . '.css' ), array(), '2.31' );
+ wp_enqueue_style( Plugin::CmnScriptId( $id ), add_query_arg( Plugin::GetFileUrlPackageParams(), $fileUrl . '/' . $id . '.css' ), array(), '2.31.1' );
self::$g_aAlreadyIncludedObj[ 'css' ][ $id ] = true;
}
@@ -2346,7 +2346,7 @@
$scrHndId = Plugin::CmnScriptId( $id );
- wp_register_script( $scrHndId, add_query_arg( Plugin::GetFileUrlPackageParams(), $fileUrl . '/' . $id . '.js' ), $deps, '2.31' );
+ wp_register_script( $scrHndId, add_query_arg( Plugin::GetFileUrlPackageParams(), $fileUrl . '/' . $id . '.js' ), $deps, '2.31.1' );
if( $id == 'Gen' )
Plugin::Loc_ScriptLoad( $scrHndId );
wp_enqueue_script( $scrHndId );
@@ -2791,7 +2791,7 @@
var sendDataUrl = "<?php echo( Gen::GetArrField( $rmtCfg, 'Questionnaires.SendAnswerUrlTpl' ) ); ?>";
sendDataUrl = sendDataUrl.replace( "{EndPointId}", encodeURI( "<?php echo( Wp::GetSiteId() ); ?>" ) );
- sendDataUrl = sendDataUrl.replace( "{PluginVersion}", encodeURI( "2.31" ) );
+ sendDataUrl = sendDataUrl.replace( "{PluginVersion}", encodeURI( "2.31.1" ) );
sendDataUrl = sendDataUrl.replace( "{PluginMode}", encodeURI( "base" ) );
sendDataUrl = sendDataUrl.replace( "{PluginPackage}", encodeURI( "Base" ) );
sendDataUrl = sendDataUrl.replace( "{QuestionnaireId}", encodeURI( "<?php echo( ($q[ 'id' ]??null) ); ?>" ) );
--- a/seraphinite-accelerator/cache_ex.php
+++ b/seraphinite-accelerator/cache_ex.php
@@ -66,7 +66,7 @@
}
if( $bHdr )
- @header( 'X-Seraph-Accel-Cache: 2.31;' . $debugInfo );
+ @header( 'X-Seraph-Accel-Cache: 2.31.1;' . $debugInfo );
if( $bLog )
{
@@ -1006,7 +1006,7 @@
if( ($settCache[ 'normAgent' ]??null) )
{
$_SERVER[ 'SERAPH_ACCEL_ORIG_USER_AGENT' ] = ($_SERVER[ 'HTTP_USER_AGENT' ]??'');
- $_SERVER[ 'HTTP_USER_AGENT' ] = 'Mozilla/99999.9 AppleWebKit/9999999.99 (KHTML, like Gecko) Chrome/999999.0.9999.99 Safari/9999999.99 Seraph-Accel-Agent/2.31';
+ $_SERVER[ 'HTTP_USER_AGENT' ] = 'Mozilla/99999.9 AppleWebKit/9999999.99 (KHTML, like Gecko) Chrome/999999.0.9999.99 Safari/9999999.99 Seraph-Accel-Agent/2.31.1';
}
if( ($settCache[ 'views' ]??null) )
--- a/seraphinite-accelerator/common.php
+++ b/seraphinite-accelerator/common.php
@@ -1927,8 +1927,8 @@
'items' => array(
'.//img/@loading',
'.//iframe/@loading',
- './/link[@rel="preload"][@as="font"][not(self::node()[@seraph-accel-crit="1"])]',
- './/link[@rel="modulepreload"][not(self::node()[@seraph-accel-crit="1"])]',
+ './/link[@rel="preload"][@as="font"][not(self::node()[@data-seraph-accel-crit="1"])]',
+ './/link[@rel="modulepreload"][not(self::node()[@data-seraph-accel-crit="1"])]',
),
),
'rpl' => array(
@@ -4368,7 +4368,7 @@
function GetViewTypeUserAgent( $viewsDeviceGrp )
{
- return( 'Mozilla/99999.9 AppleWebKit/9999999.99 (KHTML, like Gecko) Chrome/999999.0.9999.99 Safari/9999999.99 Seraph-Accel-Agent/2.31 ' . ucwords( implode( ' ', Gen::GetArrField( $viewsDeviceGrp, array( 'agents' ), array() ) ) ) );
+ return( 'Mozilla/99999.9 AppleWebKit/9999999.99 (KHTML, like Gecko) Chrome/999999.0.9999.99 Safari/9999999.99 Seraph-Accel-Agent/2.31.1 ' . ucwords( implode( ' ', Gen::GetArrField( $viewsDeviceGrp, array( 'agents' ), array() ) ) ) );
}
function CorrectRequestScheme( &$serverArgs, $target = null )
@@ -5978,7 +5978,7 @@
$args = array( 'sslverify' => false, 'timeout' => $timeout, 'headers' => array() );
if( $userAgentCmn )
- $args[ 'headers' ][ 'User-Agent' ] = 'Mozilla/99999.9 AppleWebKit/9999999.99 (KHTML, like Gecko) Chrome/999999.0.9999.99 Safari/9999999.99 Seraph-Accel-Agent/2.31';
+ $args[ 'headers' ][ 'User-Agent' ] = 'Mozilla/99999.9 AppleWebKit/9999999.99 (KHTML, like Gecko) Chrome/999999.0.9999.99 Safari/9999999.99 Seraph-Accel-Agent/2.31.1';
if( $serverId = Net::UrlParse( $url ) )
{
@@ -6503,7 +6503,7 @@
foreach( $aHdrs as $hdrsId => $headers )
{
if( !isset( $headers[ 'User-Agent' ] ) )
- $headers[ 'User-Agent' ] = ($headers[ 'X-Seraph-Accel-Postpone-User-Agent' ]??'Mozilla/99999.9 AppleWebKit/9999999.99 (KHTML, like Gecko) Chrome/999999.0.9999.99 Safari/9999999.99 Seraph-Accel-Agent/2.31');
+ $headers[ 'User-Agent' ] = ($headers[ 'X-Seraph-Accel-Postpone-User-Agent' ]??'Mozilla/99999.9 AppleWebKit/9999999.99 (KHTML, like Gecko) Chrome/999999.0.9999.99 Safari/9999999.99 Seraph-Accel-Agent/2.31.1');
$headers[ 'User-Agent' ] = str_ireplace( 'Seraph-Accel-Agent/', 'Seraph-Accel-Agent-WarmUp/', $headers[ 'User-Agent' ] );
unset( $headers[ 'X-Seraph-Accel-Postpone-User-Agent' ] );
--- a/seraphinite-accelerator/main.php
+++ b/seraphinite-accelerator/main.php
@@ -42,7 +42,7 @@
function _AddMenus( $accepted = false )
{
- add_menu_page( Plugin::GetPluginString( 'TitleLong' ), Plugin::GetNavMenuTitle(), 'manage_options', 'seraph_accel_manage', $accepted ? 'seraph_accel\_ManagePage' : 'seraph_accel\Plugin::OutputNotAcceptedPageContent', Plugin::FileUri( 'icon.png?v=2.31', __FILE__ ) );
+ add_menu_page( Plugin::GetPluginString( 'TitleLong' ), Plugin::GetNavMenuTitle(), 'manage_options', 'seraph_accel_manage', $accepted ? 'seraph_accel\_ManagePage' : 'seraph_accel\Plugin::OutputNotAcceptedPageContent', Plugin::FileUri( 'icon.png?v=2.31.1', __FILE__ ) );
add_submenu_page( 'seraph_accel_manage', esc_html_x( 'Title', 'admin.Manage', 'seraphinite-accelerator' ), esc_html_x( 'Title', 'admin.Manage', 'seraphinite-accelerator' ), 'manage_options', 'seraph_accel_manage', $accepted ? 'seraph_accel\_ManagePage' : 'seraph_accel\Plugin::OutputNotAcceptedPageContent' );
add_submenu_page( 'seraph_accel_manage', Wp::GetLocString( 'Settings' ), Wp::GetLocString( 'Settings' ), 'manage_options', 'seraph_accel_settings', $accepted ? 'seraph_accel\_SettingsPage' : 'seraph_accel\Plugin::OutputNotAcceptedPageContent' );
}
@@ -1314,7 +1314,7 @@
function _ManagePage()
{
Plugin::CmnScripts( array( 'Cmn', 'Gen', 'Ui', 'Net', 'AdminUi' ) );
- wp_register_script( Plugin::ScriptId( 'Admin' ), add_query_arg( Plugin::GetFileUrlPackageParams(), Plugin::FileUrl( 'Admin.js', __FILE__ ) ), array_merge( array( 'jquery' ), Plugin::CmnScriptId( array( 'Cmn', 'Gen', 'Ui', 'Net' ) ) ), '2.31' );
+ wp_register_script( Plugin::ScriptId( 'Admin' ), add_query_arg( Plugin::GetFileUrlPackageParams(), Plugin::FileUrl( 'Admin.js', __FILE__ ) ), array_merge( array( 'jquery' ), Plugin::CmnScriptId( array( 'Cmn', 'Gen', 'Ui', 'Net' ) ) ), '2.31.1' );
Plugin::Loc_ScriptLoad( Plugin::ScriptId( 'Admin' ) );
wp_enqueue_script( Plugin::ScriptId( 'Admin' ) );
@@ -1560,7 +1560,7 @@
{
$rmtCfg = PluginRmtCfg::Get();
- $urlLogoImg = add_query_arg( array( 'v' => '2.31' ), Plugin::FileUri( 'Images/hosting-icon-banner.svg', __FILE__ ) );
+ $urlLogoImg = add_query_arg( array( 'v' => '2.31.1' ), Plugin::FileUri( 'Images/hosting-icon-banner.svg', __FILE__ ) );
$urlMoreInfo = Plugin::RmtCfgFld_GetLoc( $rmtCfg, 'Links.UrlHostingInfo' );
$res = '';
--- a/seraphinite-accelerator/oper.php
+++ b/seraphinite-accelerator/oper.php
@@ -687,7 +687,7 @@
if( $ctx -> op == 1 )
{
- if( Images_ProcessSrcSizeAlternatives_Cache_Cleanup( $siteDir . '/d', $ctx -> tmCur - $ctx -> timeout, array( $ctx, 'isAborted' ) ) === false )
+ if( $ctx -> timeout > 0 && Images_ProcessSrcSizeAlternatives_Cache_Cleanup( $siteDir . '/d', $ctx -> tmCur - $ctx -> timeout, array( $ctx, 'isAborted' ) ) === false )
return( false );
if( ExtContents_Local_CacheClean( $siteDir, $ctx -> tmCur - $ctx -> timeoutExtObj, $ctx -> tmCur, array( $ctx, 'isAborted' ) ) === false )
@@ -728,7 +728,7 @@
if( ($ctx -> datasDel[ $dataType ][ $dataId ]??null) )
{
$tmFile = @filemtime( $dataFile );
- if( $tmFile !== false && $ctx -> tmCur - $tmFile > min( $ctx -> timeout, ( 48 * 60 * 60 ) ) )
+ if( $tmFile !== false && $ctx -> tmCur - $tmFile > ( $ctx -> timeout > 0 ? min( $ctx -> timeout, ( 48 * 60 * 60 ) ) : ( 48 * 60 * 60 ) ) )
@unlink( $dataFile );
}
}
@@ -1162,7 +1162,7 @@
foreach( $viewId === null ? array( 'cmn' ) : $viewId as $viewIdI )
if( CacheOpViewsHeadersGetViewId( $viewIdI ) == 'cmn' )
- $res[ $viewIdI ] = array( 'User-Agent' => 'Mozilla/99999.9 AppleWebKit/9999999.99 (KHTML, like Gecko) Chrome/999999.0.9999.99 Safari/9999999.99 Seraph-Accel-Agent/2.31' );
+ $res[ $viewIdI ] = array( 'User-Agent' => 'Mozilla/99999.9 AppleWebKit/9999999.99 (KHTML, like Gecko) Chrome/999999.0.9999.99 Safari/9999999.99 Seraph-Accel-Agent/2.31.1' );
if( ($settCache[ 'views' ]??null) )
{
--- a/seraphinite-accelerator/options.php
+++ b/seraphinite-accelerator/options.php
@@ -151,7 +151,7 @@
function( $callbacks_args, $box )
{
extract( $box[ 'args' ] );
- $o = Ui::TextArea( null, $contLog, array( 'wrap' => 'off', 'class' => 'code', 'style' => array( 'width' => '100%', 'min-height' => '17em', 'max-height' => '100em' ) ) );
+ $o = Ui::TextArea( null, Ui::EscHtml( $contLog ), array( 'wrap' => 'off', 'class' => 'code', 'style' => array( 'width' => '100%', 'min-height' => '17em', 'max-height' => '100em' ) ) );
echo( $o );
}
, get_defined_vars(), 'body', '', null
@@ -185,7 +185,7 @@
}
Plugin::CmnScripts( array( 'Cmn', 'Gen', 'Ui', 'Net', 'AdminUi' ) );
- wp_register_script( Plugin::ScriptId( 'Admin' ), add_query_arg( Plugin::GetFileUrlPackageParams(), Plugin::FileUrl( 'Admin.js', __FILE__ ) ), array_merge( array( 'jquery' ), Plugin::CmnScriptId( array( 'Cmn', 'Gen', 'Ui', 'Net' ) ) ), '2.31' );
+ wp_register_script( Plugin::ScriptId( 'Admin' ), add_query_arg( Plugin::GetFileUrlPackageParams(), Plugin::FileUrl( 'Admin.js', __FILE__ ) ), array_merge( array( 'jquery' ), Plugin::CmnScriptId( array( 'Cmn', 'Gen', 'Ui', 'Net' ) ) ), '2.31.1' );
Plugin::Loc_ScriptLoad( Plugin::ScriptId( 'Admin' ) );
wp_enqueue_script( Plugin::ScriptId( 'Admin' ) );
--- a/seraphinite-accelerator/plugin_root.php
+++ b/seraphinite-accelerator/plugin_root.php
@@ -5,7 +5,7 @@
Description: Turns on site high speed to be attractive for people and search engines.
Text Domain: seraphinite-accelerator
Domain Path: /languages
-Version: 2.31
+Version: 2.31.1
Author: Seraphinite Solutions
Author URI: https://www.s-sols.com
License: GPLv2 or later (if another license is not provided)