From e3e2c7190106382d1e0b1e2b9a61c00cfc19358c Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Wed, 17 Jan 2024 16:08:20 +0000 Subject: [PATCH] MDL-80731 core: ensure valid /Lang attribute in generated PDF files. As with the changes in 4be39296, PDF files have criteria for validity of language identifiers. --- lib/pdflib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pdflib.php b/lib/pdflib.php index 64a76c6fd44..b38787641b6 100644 --- a/lib/pdflib.php +++ b/lib/pdflib.php @@ -168,9 +168,9 @@ class pdf extends TCPDF { parent::__construct($orientation, $unit, $format, $unicode, $encoding); - // theses replace the tcpdf's config/lang/ definitions + // These values replace TCPDF's own config/lang definitions. $this->l['w_page'] = get_string('page'); - $this->l['a_meta_language'] = current_language(); + $this->l['a_meta_language'] = get_html_lang_attribute_value(current_language()); $this->l['a_meta_charset'] = 'UTF-8'; $this->l['a_meta_dir'] = get_string('thisdirection', 'langconfig'); }