Use md5 hash for transient names so that the lengths are valid. Closes #4851

This commit is contained in:
Mike Jolley 2014-02-19 14:05:32 +00:00
parent 1e410ebcdc
commit 9303908d7b
1 changed files with 3 additions and 3 deletions

View File

@ -228,7 +228,7 @@
if ( strstr( $dirname, 'woocommerce' ) ) {
if ( false === ( $version_data = get_transient( $plugin . '_version_data' ) ) ) {
if ( false === ( $version_data = get_transient( md5( $plugin ) . '_version_data' ) ) ) {
$changelog = wp_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $dirname . '/changelog.txt' );
$cl_lines = explode( "\n", wp_remote_retrieve_body( $changelog ) );
if ( ! empty( $cl_lines ) ) {
@ -239,7 +239,7 @@
$version = preg_replace( '~[^0-9,.]~' , '' ,stristr( $cl_line , "version" ) );
$update = trim( str_replace( "*" , "" , $cl_lines[ $line_num + 1 ] ) );
$version_data = array( 'date' => $date , 'version' => $version , 'update' => $update , 'changelog' => $changelog );
set_transient( $plugin . '_version_data', $version_data , 60*60*12 );
set_transient( md5( $plugin ) . '_version_data', $version_data, 60*60*12 );
break;
}
}
@ -389,7 +389,7 @@
$active_theme = wp_get_theme();
if ( $active_theme->{'Author URI'} == 'http://www.woothemes.com' ) :
$theme_dir = strtolower( str_replace( ' ','', $active_theme->Name ) );
$theme_dir = substr( strtolower( str_replace( ' ','', $active_theme->Name ) ), 0, 45 );
if ( false === ( $theme_version_data = get_transient( $theme_dir . '_version_data' ) ) ) :