Permalink
Browse files

MDL-34441 always use proper charset in htmlspecialchars() calls

  • Loading branch information...
skodak committed Jul 22, 2012
1 parent 4b195fe commit 6b986b7b6aa38725684814633e1b7880423f6c5d
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/dtl/xml_database_exporter.php
@@ -48,7 +48,7 @@
public function begin_database_export($version, $release, $timestamp, $description) {
$this->output('<?xml version="1.0" encoding="utf-8"?>');
//TODO add xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" and schema information
- $this->output('<moodle_database version="'.$version.'" release="'.$release.'" timestamp="'.$timestamp.'"'.(empty ($description) ? '' : ' comment="'.htmlspecialchars($description, ENT_QUOTES).'"').'>');
+ $this->output('<moodle_database version="'.$version.'" release="'.$release.'" timestamp="'.$timestamp.'"'.(empty ($description) ? '' : ' comment="'.htmlspecialchars($description, ENT_QUOTES, 'UTF-8').'"').'>');
}
/**
@@ -90,7 +90,7 @@ public function export_table_data(xmldb_table $table, $data) {
if (is_null($value)) {
$this->output('<field name="'.$key.'" value="null" />');
} else {
- $this->output('<field name="'.$key.'">'.htmlspecialchars($value, ENT_NOQUOTES).'</field>');
+ $this->output('<field name="'.$key.'">'.htmlspecialchars($value, ENT_NOQUOTES, 'UTF-8').'</field>');
}
}
$this->output('</record>');

0 comments on commit 6b986b7

Please sign in to comment.