Skip to content

Commit

Permalink
= 4.2.5.4 =
Browse files Browse the repository at this point in the history
~ Fixed: security.
  • Loading branch information
tungnxt89 committed Oct 31, 2023
1 parent 57a3ba2 commit cdf8f63
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion inc/class-lp-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ public static function sanitize_params_submitted( $value, string $type_content =
}
} elseif ( is_array( $value ) ) {
foreach ( $value as $k => $v ) {
$value[ $k ] = self::sanitize_params_submitted( $v, $type_content );
unset( $value[ $k ] );
$value[ sanitize_key( $k ) ] = self::sanitize_params_submitted( $v, $type_content );
}
}

Expand Down
4 changes: 2 additions & 2 deletions inc/class-lp-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function add_rewrite_rules(): array {
}

// Todo fix: temporary addons before addons updated, when all addons updated, this code will be removed
if ( class_exists( 'LP_Addon_H5p_Preload' ) ) {
if ( class_exists( 'LP_Addon_H5p_Preload' ) ) { // LP_Addon_H5p fix on v4.0.3
$h5p_slug = urldecode( sanitize_title_with_dashes( LP_Settings::get_option( 'h5p_slug', 'h5p' ) ) );
$rules['course-with-cat-items'][ LP_H5P_CPT ] = [
"^{$course_slug}(?:/{$h5p_slug}/([^/]+))/?$" =>
Expand All @@ -150,7 +150,7 @@ public function add_rewrite_rules(): array {
}

// Todo Fix: temporary addons before addons updated, when all addons updated, this code will be removed
if ( class_exists( 'LP_Addon_H5p_Preload' ) ) {
if ( class_exists( 'LP_Addon_H5p_Preload' ) ) { // LP_Addon_H5p fix on v4.0.3
$h5p_slug = urldecode( sanitize_title_with_dashes( LP_Settings::get_option( 'h5p_slug', 'h5p' ) ) );
$rules['course-items'][ LP_H5P_CPT ] = [
"^{$course_slug}/([^/]+)(?:/{$h5p_slug}/([^/]+))/?$" =>
Expand Down
1 change: 1 addition & 0 deletions inc/lp-webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @author ThimPress
* @package LearnPress/Functions
* @version 1.0
* @deprecated 4.2.5.4 Addon learnpress-2checkout-payment v4.0.1 is using
*/

defined( 'ABSPATH' ) || exit();
Expand Down
2 changes: 1 addition & 1 deletion inc/user-item/class-lp-user-item-course.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public function calculate_course_results( bool $force_cache = false ) {

LP_Cache::cache_load_first( 'set', $key_first_cache, $results );
} catch ( Throwable $e ) {

error_log( __METHOD__ . ': ' . $e->getMessage() );
}

return $results;
Expand Down
4 changes: 2 additions & 2 deletions learnpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: http://thimpress.com/learnpress
* Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
* Author: ThimPress
* Version: 4.2.5.3
* Version: 4.2.5.4-beta-1
* Author URI: http://thimpress.com
* Requires at least: 6.2
* Requires PHP: 7.0
Expand Down Expand Up @@ -368,7 +368,7 @@ private function include_files_global() {
include_once 'inc/lp-core-functions.php';
include_once 'inc/class-lp-autoloader.php';

include_once 'inc/lp-webhooks.php';
include_once 'inc/lp-webhooks.php'; // Addon learnpress-2checkout-payment v4.0.1 is using, when update v4.0.2 don't need load it.
include_once 'inc/class-lp-request-handler.php';

include_once 'inc/admin/helpers/class-lp-plugins-helper.php';
Expand Down

0 comments on commit cdf8f63

Please sign in to comment.