Skip to content

Commit

Permalink
Learn Theme: Not all browsers set the referer, handle the case of it …
Browse files Browse the repository at this point in the history
…being unset.
  • Loading branch information
dd32 committed Jan 9, 2025
1 parent 2782b81 commit de23cb3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
$course_id = Sensei()->lesson->get_course_id( $lesson_id );
$is_learning_mode = Sensei_Course_Theme_Option::has_learning_mode_enabled( $course_id );
$is_awaiting_grade = Sensei_Quiz::is_quiz_awaiting_grade_for_user( $lesson_id, get_current_user_id() );
$is_pending_grade = $is_learning_mode && $is_awaiting_grade;
$is_from_lesson = strpos( $_SERVER['HTTP_REFERER'], '/lesson/' ) !== false;
$is_pending_grade = $is_learning_mode && $is_awaiting_grade;
$is_from_lesson = strpos( $_SERVER['HTTP_REFERER'] ?? '', '/lesson/' ) !== false;

?>

Expand Down

0 comments on commit de23cb3

Please sign in to comment.