Skip to content

Commit 1680f72

Browse files
authored
Merge pull request #2924 from gocodebox/dev
Release 8.0.5
2 parents 90902b5 + 2abad0c commit 1680f72

File tree

5 files changed

+336
-7
lines changed

5 files changed

+336
-7
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
LifterLMS Changelog
22
===================
33

4+
v8.0.5 - 2025-04-17
5+
-------------------
6+
7+
##### Updates and Enhancements
8+
9+
+ Modifies the allowed HTML for a form, in case the allowed post values in WP have been filtered. [#2922](https://github.com/gocodebox/lifterlms/issues/2922)
10+
11+
412
v8.0.4 - 2025-04-11
513
-------------------
614

class-lifterlms.php

Lines changed: 324 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class LifterLMS {
3434
*
3535
* @var string
3636
*/
37-
public $version = '8.0.4';
37+
public $version = '8.0.5';
3838

3939
/**
4040
* LLMS_Assets instance
@@ -271,9 +271,330 @@ private function define_constants() {
271271
)
272272
);
273273

274-
// Start with the wp_kses_post allowed fields and ensure all attributes are permitted.
275-
$allowed_post_fields = wp_kses_allowed_html( 'post' );
274+
// Defining ourselves rather than relying on wp_kses_allowed_html( 'post' ) because it could be filtered.
275+
$allowed_post_fields = array(
276+
'address' => array(),
277+
'a' => array(
278+
'href' => true,
279+
'rel' => true,
280+
'rev' => true,
281+
'name' => true,
282+
'target' => true,
283+
'download' => array(
284+
'valueless' => 'y',
285+
),
286+
),
287+
'abbr' => array(),
288+
'acronym' => array(),
289+
'area' => array(
290+
'alt' => true,
291+
'coords' => true,
292+
'href' => true,
293+
'nohref' => true,
294+
'shape' => true,
295+
'target' => true,
296+
),
297+
'article' => array(
298+
'align' => true,
299+
),
300+
'aside' => array(
301+
'align' => true,
302+
),
303+
'audio' => array(
304+
'autoplay' => true,
305+
'controls' => true,
306+
'loop' => true,
307+
'muted' => true,
308+
'preload' => true,
309+
'src' => true,
310+
),
311+
'b' => array(),
312+
'bdo' => array(),
313+
'big' => array(),
314+
'blockquote' => array(
315+
'cite' => true,
316+
),
317+
'br' => array(),
318+
'button' => array(
319+
'disabled' => true,
320+
'name' => true,
321+
'type' => true,
322+
'value' => true,
323+
),
324+
'caption' => array(
325+
'align' => true,
326+
),
327+
'cite' => array(),
328+
'code' => array(),
329+
'col' => array(
330+
'align' => true,
331+
'char' => true,
332+
'charoff' => true,
333+
'span' => true,
334+
'valign' => true,
335+
'width' => true,
336+
),
337+
'colgroup' => array(
338+
'align' => true,
339+
'char' => true,
340+
'charoff' => true,
341+
'span' => true,
342+
'valign' => true,
343+
'width' => true,
344+
),
345+
'del' => array(
346+
'datetime' => true,
347+
),
348+
'dd' => array(),
349+
'dfn' => array(),
350+
'details' => array(
351+
'align' => true,
352+
'open' => true,
353+
),
354+
'div' => array(
355+
'align' => true,
356+
),
357+
'dl' => array(),
358+
'dt' => array(),
359+
'em' => array(),
360+
'fieldset' => array(),
361+
'figure' => array(
362+
'align' => true,
363+
),
364+
'figcaption' => array(
365+
'align' => true,
366+
),
367+
'font' => array(
368+
'color' => true,
369+
'face' => true,
370+
'size' => true,
371+
),
372+
'footer' => array(
373+
'align' => true,
374+
),
375+
'h1' => array(
376+
'align' => true,
377+
),
378+
'h2' => array(
379+
'align' => true,
380+
),
381+
'h3' => array(
382+
'align' => true,
383+
),
384+
'h4' => array(
385+
'align' => true,
386+
),
387+
'h5' => array(
388+
'align' => true,
389+
),
390+
'h6' => array(
391+
'align' => true,
392+
),
393+
'header' => array(
394+
'align' => true,
395+
),
396+
'hgroup' => array(
397+
'align' => true,
398+
),
399+
'hr' => array(
400+
'align' => true,
401+
'noshade' => true,
402+
'size' => true,
403+
'width' => true,
404+
),
405+
'i' => array(),
406+
'img' => array(
407+
'alt' => true,
408+
'align' => true,
409+
'border' => true,
410+
'height' => true,
411+
'hspace' => true,
412+
'loading' => true,
413+
'longdesc' => true,
414+
'vspace' => true,
415+
'src' => true,
416+
'usemap' => true,
417+
'width' => true,
418+
),
419+
'ins' => array(
420+
'datetime' => true,
421+
'cite' => true,
422+
),
423+
'kbd' => array(),
424+
'label' => array(
425+
'for' => true,
426+
),
427+
'legend' => array(
428+
'align' => true,
429+
),
430+
'li' => array(
431+
'align' => true,
432+
'value' => true,
433+
),
434+
'main' => array(
435+
'align' => true,
436+
),
437+
'map' => array(
438+
'name' => true,
439+
),
440+
'mark' => array(),
441+
'menu' => array(
442+
'type' => true,
443+
),
444+
'nav' => array(
445+
'align' => true,
446+
),
447+
'object' => array(
448+
'data' => array(
449+
'required' => true,
450+
'value_callback' => '_wp_kses_allow_pdf_objects',
451+
),
452+
'type' => array(
453+
'required' => true,
454+
'values' => array( 'application/pdf' ),
455+
),
456+
),
457+
'p' => array(
458+
'align' => true,
459+
),
460+
'pre' => array(
461+
'width' => true,
462+
),
463+
'q' => array(
464+
'cite' => true,
465+
),
466+
'rb' => array(),
467+
'rp' => array(),
468+
'rt' => array(),
469+
'rtc' => array(),
470+
'ruby' => array(),
471+
's' => array(),
472+
'samp' => array(),
473+
'span' => array(
474+
'align' => true,
475+
),
476+
'section' => array(
477+
'align' => true,
478+
),
479+
'small' => array(),
480+
'strike' => array(),
481+
'strong' => array(),
482+
'sub' => array(),
483+
'summary' => array(
484+
'align' => true,
485+
),
486+
'sup' => array(),
487+
'table' => array(
488+
'align' => true,
489+
'bgcolor' => true,
490+
'border' => true,
491+
'cellpadding' => true,
492+
'cellspacing' => true,
493+
'rules' => true,
494+
'summary' => true,
495+
'width' => true,
496+
),
497+
'tbody' => array(
498+
'align' => true,
499+
'char' => true,
500+
'charoff' => true,
501+
'valign' => true,
502+
),
503+
'td' => array(
504+
'abbr' => true,
505+
'align' => true,
506+
'axis' => true,
507+
'bgcolor' => true,
508+
'char' => true,
509+
'charoff' => true,
510+
'colspan' => true,
511+
'headers' => true,
512+
'height' => true,
513+
'nowrap' => true,
514+
'rowspan' => true,
515+
'scope' => true,
516+
'valign' => true,
517+
'width' => true,
518+
),
519+
'textarea' => array(
520+
'cols' => true,
521+
'rows' => true,
522+
'disabled' => true,
523+
'name' => true,
524+
'readonly' => true,
525+
),
526+
'tfoot' => array(
527+
'align' => true,
528+
'char' => true,
529+
'charoff' => true,
530+
'valign' => true,
531+
),
532+
'th' => array(
533+
'abbr' => true,
534+
'align' => true,
535+
'axis' => true,
536+
'bgcolor' => true,
537+
'char' => true,
538+
'charoff' => true,
539+
'colspan' => true,
540+
'headers' => true,
541+
'height' => true,
542+
'nowrap' => true,
543+
'rowspan' => true,
544+
'scope' => true,
545+
'valign' => true,
546+
'width' => true,
547+
),
548+
'thead' => array(
549+
'align' => true,
550+
'char' => true,
551+
'charoff' => true,
552+
'valign' => true,
553+
),
554+
'title' => array(),
555+
'tr' => array(
556+
'align' => true,
557+
'bgcolor' => true,
558+
'char' => true,
559+
'charoff' => true,
560+
'valign' => true,
561+
),
562+
'track' => array(
563+
'default' => true,
564+
'kind' => true,
565+
'label' => true,
566+
'src' => true,
567+
'srclang' => true,
568+
),
569+
'tt' => array(),
570+
'u' => array(),
571+
'ul' => array(
572+
'type' => true,
573+
),
574+
'ol' => array(
575+
'start' => true,
576+
'type' => true,
577+
'reversed' => true,
578+
),
579+
'var' => array(),
580+
'video' => array(
581+
'autoplay' => true,
582+
'controls' => true,
583+
'height' => true,
584+
'loop' => true,
585+
'muted' => true,
586+
'playsinline' => true,
587+
'poster' => true,
588+
'preload' => true,
589+
'src' => true,
590+
'width' => true,
591+
),
592+
);
593+
276594
foreach ( $allowed_post_fields as $field => $attributes ) {
595+
if ( ! is_array( $attributes ) ) {
596+
continue;
597+
}
277598
$allowed_post_fields[ $field ] = array_merge( $attributes, $allowed_atts );
278599
}
279600

lifterlms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Plugin Name: LifterLMS
1111
* Plugin URI: https://lifterlms.com/
1212
* Description: Complete e-learning platform to sell online courses, protect lessons, offer memberships, and quiz students. WP Learning Management System.
13-
* Version: 8.0.4
13+
* Version: 8.0.5
1414
* Author: LifterLMS
1515
* Author URI: https://lifterlms.com/
1616
* Text Domain: lifterlms

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lifterlms",
3-
"version": "8.0.4",
3+
"version": "8.0.5",
44
"description": "LifterLMS by codeBOX",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)