--- /dev/null
+<?php
+
+/***************************************************************************\
+ * SPIP, Systeme de publication pour l'internet *
+ * *
+ * Copyright (c) 2001-2020 *
+ * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
+ * *
+ * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
+ * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
+\***************************************************************************/
+
+/**
+ * Gestion des modes de documents
+ *
+ * @package SPIP\Medias\Modes
+ */
+if (!defined('_ECRIRE_INC_VERSION')) {
+ return;
+}
+
+/**
+ * Determiner le statut automatique d'un document
+ * @param int $id_document
+ * @param string $statut_ancien
+ * @param string $date_publication_ancienne
+ * @return array|false
+ */
+function inc_determiner_statut_document($id_document, $statut_ancien, $date_publication_ancienne) {
+
+ $statut = 'prepa';
+
+ $trouver_table = charger_fonction('trouver_table', 'base');
+ $res = sql_select(
+ 'id_objet,objet',
+ 'spip_documents_liens',
+ "objet!='document' AND id_document=" . intval($id_document)
+ );
+
+ // On aura 19 jours 3h14 et 7 secondes pour corriger en 2038 (limitation de la représentation POSIX du temps sur les 32 bits)
+ $date_publication = strtotime('2038-01-01 00:00:00');
+ include_spip('base/objets');
+ while ($row = sql_fetch($res)) {
+ if (
+ // cas particulier des rubriques qui sont publiees des qu'elles contiennent un document !
+ $row['objet'] == 'rubrique'
+ // ou si objet publie selon sa declaration
+ or objet_test_si_publie($row['objet'], $row['id_objet'])
+ ) {
+ $statut = 'publie';
+ $date_publication = 0;
+ continue;
+ } // si pas publie, et article, il faut checker la date de post-publi eventuelle
+ elseif ($row['objet'] == 'article'
+ and $row2 = sql_fetsel(
+ 'date',
+ 'spip_articles',
+ 'id_article=' . intval($row['id_objet']) . " AND statut='publie'"
+ )
+ ) {
+ $statut = 'publie';
+ $date_publication = min($date_publication, strtotime($row2['date']));
+ }
+ }
+
+ $date_publication = date('Y-m-d H:i:s', $date_publication);
+ if ($statut == 'publie' and $statut_ancien == 'publie' and $date_publication == $date_publication_ancienne) {
+ return false;
+ }
+ if ($statut != 'publie' and $statut_ancien != 'publie' and $statut_ancien != '0') {
+ return false;
+ }
+
+ $champs = [];
+ if ($statut !== $statut_ancien) {
+ $champs['statut'] = $statut;
+ }
+ if ($date_publication !== $date_publication_ancienne) {
+ $champs['date_publication'] = $date_publication;
+ }
+
+ return $champs;
+}
--- /dev/null
+<?php
+
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org> //
+// available at https://github.com/JamesHeinrich/getID3 //
+// or https://www.getid3.org //
+// or http://getid3.sourceforge.net //
+// see readme.txt for more details //
+/////////////////////////////////////////////////////////////////
+// //
+// module.archive.hpk.php //
+// module for analyzing HPK files //
+// dependencies: NONE //
+// ///
+/////////////////////////////////////////////////////////////////
+
+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
+
+class getid3_hpk extends getid3_handler
+{
+ /**
+ * @return bool
+ */
+ public function Analyze() {
+ $info = &$this->getid3->info;
+
+ $info['fileformat'] = 'hpk';
+
+ $this->fseek($info['avdataoffset']);
+ $HPKheader = $this->fread(36);
+
+ if (substr($HPKheader, 0, 4) == 'BPUL') {
+
+ $info['hpk']['header']['signature'] = substr($HPKheader, 0, 4);
+ $info['hpk']['header']['data_offset'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 4, 4));
+ $info['hpk']['header']['fragments_per_file'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 8, 4));
+ //$info['hpk']['header']['unknown1'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 12, 4));
+ $info['hpk']['header']['fragments_residual_offset'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 16, 4));
+ $info['hpk']['header']['fragments_residual_count'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 20, 4));
+ //$info['hpk']['header']['unknown2'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 24, 4));
+ $info['hpk']['header']['fragmented_filesystem_offset'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 28, 4));
+ $info['hpk']['header']['fragmented_filesystem_length'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 32, 4));
+
+ $info['hpk']['header']['filesystem_entries'] = $info['hpk']['header']['fragmented_filesystem_length'] / ($info['hpk']['header']['fragments_per_file'] * 8);
+ $this->fseek($info['hpk']['header']['fragmented_filesystem_offset']);
+ for ($i = 0; $i < $info['hpk']['header']['filesystem_entries']; $i++) {
+ $offset = getid3_lib::LittleEndian2Int($this->fread(4));
+ $length = getid3_lib::LittleEndian2Int($this->fread(4));
+ $info['hpk']['filesystem'][$i] = array('offset' => $offset, 'length' => $length);
+ }
+
+$this->error('HPK parsing incomplete (and mostly broken) in this version of getID3() ['.$this->getid3->version().']');
+
+/*
+ $filename = '';
+ $dirs = array();
+ foreach ($info['hpk']['filesystem'] as $key => $filesystemdata) {
+ $this->fseek($filesystemdata['offset']);
+ $first4 = $this->fread(4);
+ if (($first4 == 'LZ4 ') || ($first4 == 'ZLIB')) {
+ // actual data, ignore
+ $info['hpk']['toc'][$key] = array(
+ 'filename' => ltrim(implode('/', $dirs).'/'.$filename, '/'),
+ 'offset' => $filesystemdata['offset'],
+ 'length' => $filesystemdata['length'],
+ );
+ $filename = '';
+ $dirs = array();
+ } else {
+ $fragment_index = getid3_lib::LittleEndian2Int($first4);
+ $fragment_type = getid3_lib::LittleEndian2Int($this->fread(4)); // file = 0, directory = 1
+ $name_length = getid3_lib::LittleEndian2Int($this->fread(2));
+ if ($fragment_type == 1) {
+ $dirs[] = $this->fread($name_length);
+ } else {
+ $filename = $this->fread($name_length);
+ }
+ }
+ }
+*/
+
+ } else {
+ $this->error('Expecting "BPUL" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($HPKheader, 0, 4)).'"');
+ return false;
+ }
+
+ return true;
+ }
+
+}
--- /dev/null
+<?php
+
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org> //
+// available at https://github.com/JamesHeinrich/getID3 //
+// or https://www.getid3.org //
+// or http://getid3.sourceforge.net //
+// see readme.txt for more details //
+/////////////////////////////////////////////////////////////////
+// //
+// module.archive.xz.php //
+// module for analyzing XZ files //
+// dependencies: NONE //
+// ///
+/////////////////////////////////////////////////////////////////
+
+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
+
+class getid3_xz extends getid3_handler
+{
+
+ /**
+ * @return bool
+ */
+ public function Analyze() {
+ $info = &$this->getid3->info;
+
+ $this->fseek($info['avdataoffset']);
+ $xzheader = $this->fread(6);
+
+ // https://tukaani.org/xz/xz-file-format-1.0.4.txt
+ $info['xz']['stream_header']['magic'] = substr($xzheader, 0, 6);
+ if ($info['xz']['stream_header']['magic'] != "\xFD".'7zXZ'."\x00") {
+ $this->error('Invalid XZ stream header magic (expecting FD 37 7A 58 5A 00, found '.getid3_lib::PrintHexBytes($info['xz']['stream_header']['magic']).') at offset '.$info['avdataoffset']);
+ return false;
+ }
+ $info['fileformat'] = 'xz';
+ $this->error('XZ parsing not enabled in this version of getID3() ['.$this->getid3->version().']');
+ return false;
+
+ }
+
+}
--- /dev/null
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org> //
+// available at https://github.com/JamesHeinrich/getID3 //
+// or https://www.getid3.org //
+// or http://getid3.sourceforge.net //
+// see readme.txt for more details //
+/////////////////////////////////////////////////////////////////
+// //
+// module.audio.ivf.php //
+// module for analyzing IVF audio-video files //
+// dependencies: NONE //
+// ///
+/////////////////////////////////////////////////////////////////
+
+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
+
+class getid3_ivf extends getid3_handler
+{
+ /**
+ * @return bool
+ */
+ public function Analyze() {
+ $info = &$this->getid3->info;
+
+ $info['fileformat'] = 'ivf';
+ $info['video']['dataformat'] = 'ivf';
+
+ $this->fseek($info['avdataoffset']);
+ $IVFheader = $this->fread(32);
+
+ if (substr($IVFheader, 0, 4) == 'DKIF') {
+
+ // https://wiki.multimedia.cx/index.php/IVF
+ $info['ivf']['header']['signature'] = substr($IVFheader, 0, 4);
+ $info['ivf']['header']['version'] = getid3_lib::LittleEndian2Int(substr($IVFheader, 4, 2)); // should be 0
+ $info['ivf']['header']['headersize'] = getid3_lib::LittleEndian2Int(substr($IVFheader, 6, 2));
+ $info['ivf']['header']['fourcc'] = substr($IVFheader, 8, 4);
+ $info['ivf']['header']['resolution_x'] = getid3_lib::LittleEndian2Int(substr($IVFheader, 12, 2));
+ $info['ivf']['header']['resolution_y'] = getid3_lib::LittleEndian2Int(substr($IVFheader, 14, 2));
+ $info['ivf']['header']['timebase_numerator'] = getid3_lib::LittleEndian2Int(substr($IVFheader, 16, 4));
+ $info['ivf']['header']['timebase_denominator'] = getid3_lib::LittleEndian2Int(substr($IVFheader, 20, 4));
+ $info['ivf']['header']['frame_count'] = getid3_lib::LittleEndian2Int(substr($IVFheader, 24, 4));
+ //$info['ivf']['header']['reserved'] = substr($IVFheader, 28, 4);
+
+ $info['ivf']['header']['frame_rate'] = (float) $info['ivf']['header']['timebase_numerator'] / $info['ivf']['header']['timebase_denominator'];
+
+ if ($info['ivf']['header']['version'] > 0) {
+ $this->warning('Expecting IVF header version 0, found version '.$info['ivf']['header']['version'].', results may not be accurate');
+ }
+
+ $info['video']['resolution_x'] = $info['ivf']['header']['resolution_x'];
+ $info['video']['resolution_y'] = $info['ivf']['header']['resolution_y'];
+ $info['video']['codec'] = $info['ivf']['header']['fourcc'];
+
+ $info['ivf']['frame_count'] = 0;
+ while (!$this->feof()) {
+ if ($frameheader = $this->fread(12)) {
+ $framesize = getid3_lib::LittleEndian2Int(substr($frameheader, 0, 4)); // size of frame in bytes (not including the 12-byte header)
+ $timestamp = getid3_lib::LittleEndian2Int(substr($frameheader, 4, 8)); // 64-bit presentation timestamp
+ $this->fseek($framesize, SEEK_CUR);
+ $info['ivf']['frame_count']++;
+ }
+ }
+ if ($info['ivf']['frame_count']) {
+ $info['playtime_seconds'] = $timestamp / 100000;
+ $info['video']['frame_rate'] = (float) $info['ivf']['frame_count'] / $info['playtime_seconds'];
+ }
+
+ } else {
+ $this->error('Expecting "DKIF" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($IVFheader, 0, 4)).'"');
+ return false;
+ }
+
+ return true;
+ }
+
+}
--- /dev/null
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org> //
+// available at https://github.com/JamesHeinrich/getID3 //
+// or https://www.getid3.org //
+// or http://getid3.sourceforge.net //
+// see readme.txt for more details //
+/////////////////////////////////////////////////////////////////
+// //
+// module.audio.wtv.php //
+// module for analyzing WTV (Windows Recorded TV Show) //
+// audio-video files //
+// dependencies: NONE //
+// ///
+/////////////////////////////////////////////////////////////////
+
+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
+
+class getid3_wtv extends getid3_handler
+{
+ /**
+ * @return bool
+ */
+ public function Analyze() {
+ $info = &$this->getid3->info;
+
+ $info['fileformat'] = 'wtv';
+ $info['video']['dataformat'] = 'wtv';
+
+ $this->error('WTV (Windows Recorded TV Show) files not properly processed by this version of getID3() ['.$this->getid3->version().']');
+
+ return true;
+ }
+
+}
--- /dev/null
+<?php
+
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org> //
+// available at https://github.com/JamesHeinrich/getID3 //
+// or https://www.getid3.org //
+// or http://getid3.sourceforge.net //
+// see readme.txt for more details //
+/////////////////////////////////////////////////////////////////
+// //
+// module.audio.dsdiff.php //
+// module for analyzing Direct Stream Digital Interchange //
+// File Format (DSDIFF) files //
+// dependencies: NONE //
+// ///
+/////////////////////////////////////////////////////////////////
+
+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
+
+class getid3_dsdiff extends getid3_handler
+{
+ /**
+ * @return bool
+ */
+ public function Analyze() {
+ $info = &$this->getid3->info;
+
+ $this->fseek($info['avdataoffset']);
+ $DSDIFFheader = $this->fread(4);
+
+ // https://dsd-guide.com/sites/default/files/white-papers/DSDIFF_1.5_Spec.pdf
+ if (substr($DSDIFFheader, 0, 4) != 'FRM8') {
+ $this->error('Expecting "FRM8" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($DSDIFFheader, 0, 4)).'"');
+ return false;
+ }
+ unset($DSDIFFheader);
+ $this->fseek($info['avdataoffset']);
+
+ $info['encoding'] = 'ISO-8859-1'; // not certain, but assumed
+ $info['fileformat'] = 'dsdiff';
+ $info['mime_type'] = 'audio/dsd';
+ $info['audio']['dataformat'] = 'dsdiff';
+ $info['audio']['bitrate_mode'] = 'cbr';
+ $info['audio']['bits_per_sample'] = 1;
+
+ $info['dsdiff'] = array();
+ while (!$this->feof() && ($ChunkHeader = $this->fread(12))) {
+ if (strlen($ChunkHeader) < 12) {
+ $this->error('Expecting chunk header at offset '.$thisChunk['offset'].', found insufficient data in file, aborting parsing');
+ break;
+ }
+ $thisChunk = array();
+ $thisChunk['offset'] = $this->ftell() - 12;
+ $thisChunk['name'] = substr($ChunkHeader, 0, 4);
+ if (!preg_match('#^[\\x21-\\x7E]+ *$#', $thisChunk['name'])) {
+ // "a concatenation of four printable ASCII characters in the range ' ' (space, 0x20) through '~'(0x7E). Space (0x20) cannot precede printing characters; trailing spaces are allowed."
+ $this->error('Invalid chunk name "'.$thisChunk['name'].'" ('.getid3_lib::PrintHexBytes($thisChunk['name']).') at offset '.$thisChunk['offset'].', aborting parsing');
+ }
+ $thisChunk['size'] = getid3_lib::BigEndian2Int(substr($ChunkHeader, 4, 8));
+ $datasize = $thisChunk['size'] + ($thisChunk['size'] % 2); // "If the data is an odd number of bytes in length, a pad byte must be added at the end. The pad byte is not included in ckDataSize."
+
+ switch ($thisChunk['name']) {
+ case 'FRM8':
+ $thisChunk['form_type'] = $this->fread(4);
+ if ($thisChunk['form_type'] != 'DSD ') {
+ $this->error('Expecting "DSD " at offset '.($this->ftell() - 4).', found "'.getid3_lib::PrintHexBytes($thisChunk['form_type']).'", aborting parsing');
+ break 2;
+ }
+ // do nothing further, prevent skipping subchunks
+ break;
+ case 'PROP': // PROPerty chunk
+ $thisChunk['prop_type'] = $this->fread(4);
+ if ($thisChunk['prop_type'] != 'SND ') {
+ $this->error('Expecting "SND " at offset '.($this->ftell() - 4).', found "'.getid3_lib::PrintHexBytes($thisChunk['prop_type']).'", aborting parsing');
+ break 2;
+ }
+ // do nothing further, prevent skipping subchunks
+ break;
+ case 'DIIN': // eDIted master INformation chunk
+ // do nothing, just prevent skipping subchunks
+ break;
+
+ case 'FVER': // Format VERsion chunk
+ if ($thisChunk['size'] == 4) {
+ $FVER = $this->fread(4);
+ $info['dsdiff']['format_version'] = ord($FVER[0]).'.'.ord($FVER[1]).'.'.ord($FVER[2]).'.'.ord($FVER[3]);
+ unset($FVER);
+ } else {
+ $this->warning('Expecting "FVER" chunk to be 4 bytes, found '.$thisChunk['size'].' bytes, skipping chunk');
+ $this->fseek($datasize, SEEK_CUR);
+ }
+ break;
+ case 'FS ': // sample rate chunk
+ if ($thisChunk['size'] == 4) {
+ $info['dsdiff']['sample_rate'] = getid3_lib::BigEndian2Int($this->fread(4));
+ $info['audio']['sample_rate'] = $info['dsdiff']['sample_rate'];
+ } else {
+ $this->warning('Expecting "FVER" chunk to be 4 bytes, found '.$thisChunk['size'].' bytes, skipping chunk');
+ $this->fseek($datasize, SEEK_CUR);
+ }
+ break;
+ case 'CHNL': // CHaNneLs chunk
+ $thisChunk['num_channels'] = getid3_lib::BigEndian2Int($this->fread(2));
+ if ($thisChunk['num_channels'] == 0) {
+ $this->warning('channel count should be greater than zero, skipping chunk');
+ $this->fseek($datasize - 2, SEEK_CUR);
+ }
+ for ($i = 0; $i < $thisChunk['num_channels']; $i++) {
+ $thisChunk['channels'][$i] = $this->fread(4);
+ }
+ $info['audio']['channels'] = $thisChunk['num_channels'];
+ break;
+ case 'CMPR': // CoMPRession type chunk
+ $thisChunk['compression_type'] = $this->fread(4);
+ $info['audio']['dataformat'] = trim($thisChunk['compression_type']);
+ $humanReadableByteLength = getid3_lib::BigEndian2Int($this->fread(1));
+ $thisChunk['compression_name'] = $this->fread($humanReadableByteLength);
+ if (($humanReadableByteLength % 2) == 0) {
+ // need to seek to multiple of 2 bytes, human-readable string length is only one byte long so if the string is an even number of bytes we need to seek past a padding byte after the string
+ $this->fseek(1, SEEK_CUR);
+ }
+ unset($humanReadableByteLength);
+ break;
+ case 'ABSS': // ABSolute Start time chunk
+ $ABSS = $this->fread(8);
+ $info['dsdiff']['absolute_start_time']['hours'] = getid3_lib::BigEndian2Int(substr($ABSS, 0, 2));
+ $info['dsdiff']['absolute_start_time']['minutes'] = getid3_lib::BigEndian2Int(substr($ABSS, 2, 1));
+ $info['dsdiff']['absolute_start_time']['seconds'] = getid3_lib::BigEndian2Int(substr($ABSS, 3, 1));
+ $info['dsdiff']['absolute_start_time']['samples'] = getid3_lib::BigEndian2Int(substr($ABSS, 4, 4));
+ unset($ABSS);
+ break;
+ case 'LSCO': // LoudSpeaker COnfiguration chunk
+ // 0 = 2-channel stereo set-up
+ // 3 = 5-channel set-up according to ITU-R BS.775-1 [ITU]
+ // 4 = 6-channel set-up, 5-channel set-up according to ITU-R BS.775-1 [ITU], plus additional Low Frequency Enhancement (LFE) loudspeaker. Also known as "5.1 configuration"
+ // 65535 = Undefined channel set-up
+ $thisChunk['loundspeaker_config_id'] = getid3_lib::BigEndian2Int($this->fread(2));
+ break;
+ case 'COMT': // COMmenTs chunk
+ $thisChunk['num_comments'] = getid3_lib::BigEndian2Int($this->fread(2));
+ for ($i = 0; $i < $thisChunk['num_comments']; $i++) {
+ $thisComment = array();
+ $COMT = $this->fread(14);
+ $thisComment['creation_year'] = getid3_lib::BigEndian2Int(substr($COMT, 0, 2));
+ $thisComment['creation_month'] = getid3_lib::BigEndian2Int(substr($COMT, 2, 1));
+ $thisComment['creation_day'] = getid3_lib::BigEndian2Int(substr($COMT, 3, 1));
+ $thisComment['creation_hour'] = getid3_lib::BigEndian2Int(substr($COMT, 4, 1));
+ $thisComment['creation_minute'] = getid3_lib::BigEndian2Int(substr($COMT, 5, 1));
+ $thisComment['comment_type_id'] = getid3_lib::BigEndian2Int(substr($COMT, 6, 2));
+ $thisComment['comment_ref_id'] = getid3_lib::BigEndian2Int(substr($COMT, 8, 2));
+ $thisComment['string_length'] = getid3_lib::BigEndian2Int(substr($COMT, 10, 4));
+ $thisComment['comment_text'] = $this->fread($thisComment['string_length']);
+ if ($thisComment['string_length'] % 2) {
+ // commentText[] is the description of the Comment. This text must be padded with a byte at the end, if needed, to make it an even number of bytes long. This pad byte, if present, is not included in count.
+ $this->fseek(1, SEEK_CUR);
+ }
+ $thisComment['comment_type'] = $this->DSDIFFcmtType($thisComment['comment_type_id']);
+ $thisComment['comment_reference'] = $this->DSDIFFcmtRef($thisComment['comment_type_id'], $thisComment['comment_ref_id']);
+ $thisComment['creation_unix'] = mktime($thisComment['creation_hour'], $thisComment['creation_minute'], 0, $thisComment['creation_month'], $thisComment['creation_day'], $thisComment['creation_year']);
+ $thisChunk['comments'][$i] = $thisComment;
+
+ $commentkey = ($thisComment['comment_reference'] ?: 'comment');
+ $info['dsdiff']['comments'][$commentkey][] = $thisComment['comment_text'];
+ unset($thisComment);
+ }
+ break;
+ case 'MARK': // MARKer chunk
+ $MARK = $this->fread(22);
+ $thisChunk['marker_hours'] = getid3_lib::BigEndian2Int(substr($MARK, 0, 2));
+ $thisChunk['marker_minutes'] = getid3_lib::BigEndian2Int(substr($MARK, 2, 1));
+ $thisChunk['marker_seconds'] = getid3_lib::BigEndian2Int(substr($MARK, 3, 1));
+ $thisChunk['marker_samples'] = getid3_lib::BigEndian2Int(substr($MARK, 4, 4));
+ $thisChunk['marker_offset'] = getid3_lib::BigEndian2Int(substr($MARK, 8, 4));
+ $thisChunk['marker_type_id'] = getid3_lib::BigEndian2Int(substr($MARK, 12, 2));
+ $thisChunk['marker_channel'] = getid3_lib::BigEndian2Int(substr($MARK, 14, 2));
+ $thisChunk['marker_flagraw'] = getid3_lib::BigEndian2Int(substr($MARK, 16, 2));
+ $thisChunk['string_length'] = getid3_lib::BigEndian2Int(substr($MARK, 18, 4));
+ $thisChunk['description'] = ($thisChunk['string_length'] ? $this->fread($thisChunk['string_length']) : '');
+ if ($thisChunk['string_length'] % 2) {
+ // markerText[] is the description of the marker. This text must be padded with a byte at the end, if needed, to make it an even number of bytes long. This pad byte, if present, is not included in count.
+ $this->fseek(1, SEEK_CUR);
+ }
+ $thisChunk['marker_type'] = $this->DSDIFFmarkType($thisChunk['marker_type_id']);
+ unset($MARK);
+ break;
+ case 'DIAR': // artist chunk
+ case 'DITI': // title chunk
+ $thisChunk['string_length'] = getid3_lib::BigEndian2Int($this->fread(4));
+ $thisChunk['description'] = ($thisChunk['string_length'] ? $this->fread($thisChunk['string_length']) : '');
+ if ($thisChunk['string_length'] % 2) {
+ // This text must be padded with a byte at the end, if needed, to make it an even number of bytes long. This pad byte, if present, is not included in count.
+ $this->fseek(1, SEEK_CUR);
+ }
+
+ if ($commentkey = (($thisChunk['name'] == 'DIAR') ? 'artist' : (($thisChunk['name'] == 'DITI') ? 'title' : ''))) {
+ @$info['dsdiff']['comments'][$commentkey][] = $thisChunk['description'];
+ }
+ break;
+ case 'EMID': // Edited Master ID chunk
+ if ($thisChunk['size']) {
+ $thisChunk['identifier'] = $this->fread($thisChunk['size']);
+ }
+ break;
+
+ case 'ID3 ':
+ $endOfID3v2 = $this->ftell() + $datasize; // we will need to reset the filepointer after parsing ID3v2
+
+ getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true);
+ $getid3_temp = new getID3();
+ $getid3_temp->openfile($this->getid3->filename, null, $this->getid3->fp);
+ $getid3_id3v2 = new getid3_id3v2($getid3_temp);
+ $getid3_id3v2->StartingOffset = $this->ftell();
+ if ($thisChunk['valid'] = $getid3_id3v2->Analyze()) {
+ $info['id3v2'] = $getid3_temp->info['id3v2'];
+ }
+ unset($getid3_temp, $getid3_id3v2);
+
+ $this->fseek($endOfID3v2);
+ break;
+
+ case 'DSD ': // DSD sound data chunk
+ case 'DST ': // DST sound data chunk
+ // actual audio data, we're not interested, skip
+ $this->fseek($datasize, SEEK_CUR);
+ break;
+ default:
+ $this->warning('Unhandled chunk "'.$thisChunk['name'].'"');
+ $this->fseek($datasize, SEEK_CUR);
+ break;
+ }
+
+ @$info['dsdiff']['chunks'][] = $thisChunk;
+ //break;
+ }
+ if (empty($info['audio']['bitrate']) && !empty($info['audio']['channels']) && !empty($info['audio']['sample_rate']) && !empty($info['audio']['bits_per_sample'])) {
+ $info['audio']['bitrate'] = $info['audio']['bits_per_sample'] * $info['audio']['sample_rate'] * $info['audio']['channels'];
+ }
+
+ return true;
+ }
+
+ /**
+ * @param int $cmtType
+ *
+ * @return string
+ */
+ public static function DSDIFFcmtType($cmtType) {
+ static $DSDIFFcmtType = array(
+ 0 => 'General (album) Comment',
+ 1 => 'Channel Comment',
+ 2 => 'Sound Source',
+ 3 => 'File History',
+ );
+ return (isset($DSDIFFcmtType[$cmtType]) ? $DSDIFFcmtType[$cmtType] : 'reserved');
+ }
+
+ /**
+ * @param int $cmtType
+ * @param int $cmtRef
+ *
+ * @return string
+ */
+ public static function DSDIFFcmtRef($cmtType, $cmtRef) {
+ static $DSDIFFcmtRef = array(
+ 2 => array( // Sound Source
+ 0 => 'DSD recording',
+ 1 => 'Analogue recording',
+ 2 => 'PCM recording',
+ ),
+ 3 => array( // File History
+ 0 => 'comment', // General Remark
+ 1 => 'encodeby', // Name of the operator
+ 2 => 'encoder', // Name or type of the creating machine
+ 3 => 'timezone', // Time zone information
+ 4 => 'revision', // Revision of the file
+ ),
+ );
+ switch ($cmtType) {
+ case 0:
+ // If the comment type is General Comment the comment reference must be 0
+ return '';
+ case 1:
+ // If the comment type is Channel Comment, the comment reference defines the channel number to which the comment belongs
+ return ($cmtRef ? 'channel '.$cmtRef : 'all channels');
+ case 2:
+ case 3:
+ return (isset($DSDIFFcmtRef[$cmtType][$cmtRef]) ? $DSDIFFcmtRef[$cmtType][$cmtRef] : 'reserved');
+ }
+ return 'unsupported $cmtType='.$cmtType;
+ }
+
+ /**
+ * @param int $cmtType
+ *
+ * @return string
+ */
+ public static function DSDIFFmarkType($markType) {
+ static $DSDIFFmarkType = array(
+ 0 => 'TrackStart', // Entry point for a Track start
+ 1 => 'TrackStop', // Entry point for ending a Track
+ 2 => 'ProgramStart', // Start point of 2-channel or multi-channel area
+ 3 => 'Obsolete', //
+ 4 => 'Index', // Entry point of an Index
+ );
+ return (isset($DSDIFFmarkType[$markType]) ? $DSDIFFmarkType[$markType] : 'reserved');
+ }
+
+}
--- /dev/null
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org> //
+// available at http://getid3.sourceforge.net //
+// or https://www.getid3.org //
+// also https://github.com/JamesHeinrich/getID3 //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details //
+/////////////////////////////////////////////////////////////////
+// //
+// module.audio.tak.php //
+// module for analyzing Tom's lossless Audio Kompressor //
+// dependencies: NONE //
+// ///
+/////////////////////////////////////////////////////////////////
+
+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
+
+class getid3_tak extends getid3_handler
+{
+
+ public function Analyze() {
+ $info = &$this->getid3->info;
+
+ $info['fileformat'] = 'tak';
+ $info['audio']['dataformat'] = 'tak';
+ $info['audio']['bitrate_mode'] = 'vbr';
+ $info['audio']['lossless'] = true;
+
+ $info['tak_audio']['raw'] = array();
+ $thisfile_takaudio = &$info['tak_audio'];
+ $thisfile_takaudio_raw = &$thisfile_takaudio['raw'];
+
+ $this->fseek($info['avdataoffset']);
+ $TAKMetaData = $this->fread(4);
+
+ $thisfile_takaudio_raw['magic'] = $TAKMetaData;
+ $magic = 'tBaK';
+ if ($thisfile_takaudio_raw['magic'] != $magic) {
+ $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($thisfile_takaudio_raw['magic']).'"');
+ unset($info['fileformat']);
+ return false;
+ }
+ $offset = 4; //skip magic
+ $this->fseek($offset);
+ $TAKMetaData = $this->fread(4); //read Metadata Block Header
+ $objtype = getid3_lib::BigEndian2Int(substr($TAKMetaData, 0, 1)); //Metadata Block Object Type
+ $objlength = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 1, 3)); //Metadata Block Object Lenght excluding header
+ if ($objtype == 1) { //The First Metadata Block Object must be of Type 1 (STREAMINFO)
+ $offset += 4; //skip to Metadata Block contents
+ $this->fseek($offset);
+ $TAKMetaData = $this->fread($objlength); // Get the raw Metadata Block Data
+ $thisfile_takaudio_raw['STREAMINFO'] = getid3_lib::LittleEndian2Bin(substr($TAKMetaData, 0, $objlength - 3));
+ $offset += $objlength; // Move to the next Metadata Block Object
+ $thisfile_takaudio['channels'] = getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 1, 4)) + 1;
+ $thisfile_takaudio['bits_per_sample'] = getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 5, 5)) + 8;
+ $thisfile_takaudio['sample_rate'] = getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 10, 18)) + 6000;
+ $thisfile_takaudio['samples'] = getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 31, 35));
+ $thisfile_takaudio['framesize'] = self::TAKFramesizeLookup(getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 66, 4)));
+ $thisfile_takaudio['codectype'] = self::TAKCodecTypeLookup(getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 74, 6)));
+ } else {
+ $this->error('Expecting Type 1 (STREAMINFO) Metadata Object header, but found Type "'.$objtype.'" Object instead');
+ unset($info['fileformat']);
+ return false;
+ }
+ $this->fseek($offset);
+ $TAKMetaData = $this->fread(4);
+ $objtype = getid3_lib::BigEndian2Int(substr($TAKMetaData, 0, 1));
+ $objlength = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 1, 3));
+ while ($objtype != 0) {
+ switch ($objtype) {
+ case 4 :
+ // ENCODERINFO Metadata Block
+ $offset += 4;
+ $this->fseek($offset);
+ $TAKMetaData = $this->fread($objlength);
+ $ver = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 0, 3));
+ $major = ($ver & 0xff0000) >> 16;
+ $minor = ($ver & 0x00ff00) >> 8;
+ $revision= $ver & 0x0000ff;
+ $thisfile_takaudio['version'] = 'TAK V '.$major.'.'.$minor.'.'.$revision;
+ $thisfile_takaudio['profile'] = self::TAKProfileLookup(getid3_lib::BigEndian2Int(substr($TAKMetaData, 3, 1)));
+ $offset += $objlength;
+ break;
+ case 6 :
+ // MD5 Checksum Metadata Block
+ $offset += 4;
+ $this->fseek($offset);
+ $TAKMetaData = $this->fread($objlength);
+ $thisfile_takaudio_raw['MD5Data'] = substr($TAKMetaData, 0, 16);
+ $offset += $objlength;
+ break;
+ case 7 :
+ // LASTFRAME Metadata Block
+ $offset += 4;
+ $this->fseek($offset);
+ $TAKMetaData = $this->fread($objlength);
+ $thisfile_takaudio['lastframe_pos'] = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 0, 5));
+ $thisfile_takaudio['last_frame_size'] = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 5, 3));
+ $offset += $objlength;
+ break;
+ case 3 :
+ // ORIGINALFILEDATA Metadata Block
+ $offset += 4;
+ $this->fseek($offset);
+ $TAKMetaData = $this->fread($objlength);
+ $headersize = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 0, 3));
+ $footersize = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 3, 3));
+ if ($headersize) $thisfile_takaudio_raw['header_data'] = substr($TAKMetaData, 6, $headersize);
+ if ($footersize) $thisfile_takaudio_raw['footer_data'] = substr($TAKMetaData, $headersize, $footersize);
+ $offset += $objlength;
+ break;
+ default :
+ // PADDING or SEEKTABLE Metadata Block. Just skip it
+ $offset += 4;
+ $this->fseek($offset);
+ $TAKMetaData = $this->fread($objlength);
+ $offset += $objlength;
+ break;
+ }
+ $this->fseek($offset);
+ $TAKMetaData = $this->fread(4);
+ $objtype = getid3_lib::BigEndian2Int(substr($TAKMetaData, 0, 1));
+ $objlength = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 1, 3));
+ }
+ // Finished all Metadata Blocks. So update $info['avdataoffset'] because next block is the first Audio data block
+ $info['avdataoffset'] = $offset;
+
+ $info['audio']['channels'] = $thisfile_takaudio['channels'];
+ if ($thisfile_takaudio['sample_rate'] == 0) {
+ $this->error('Corrupt TAK file: samplerate == zero');
+ return false;
+ }
+ $info['audio']['sample_rate'] = $thisfile_takaudio['sample_rate'];
+ $thisfile_takaudio['playtime'] = $thisfile_takaudio['samples'] / $thisfile_takaudio['sample_rate'];
+ if ($thisfile_takaudio['playtime'] == 0) {
+ $this->error('Corrupt TAK file: playtime == zero');
+ return false;
+ }
+ $info['playtime_seconds'] = $thisfile_takaudio['playtime'];
+ $thisfile_takaudio['compressed_size'] = $info['avdataend'] - $info['avdataoffset'];
+ $thisfile_takaudio['uncompressed_size'] = $thisfile_takaudio['samples'] * $thisfile_takaudio['channels'] * ($thisfile_takaudio['bits_per_sample'] / 8);
+ if ($thisfile_takaudio['uncompressed_size'] == 0) {
+ $this->error('Corrupt TAK file: uncompressed_size == zero');
+ return false;
+ }
+ $thisfile_takaudio['compression_ratio'] = $thisfile_takaudio['compressed_size'] / ($thisfile_takaudio['uncompressed_size'] + $offset);
+ $thisfile_takaudio['bitrate'] = (($thisfile_takaudio['samples'] * $thisfile_takaudio['channels'] * $thisfile_takaudio['bits_per_sample']) / $thisfile_takaudio['playtime']) * $thisfile_takaudio['compression_ratio'];
+ $info['audio']['bitrate'] = $thisfile_takaudio['bitrate'];
+
+ if (empty($thisfile_takaudio_raw['MD5Data'])) {
+ //$this->warning('MD5Data is not set');
+ } elseif ($thisfile_takaudio_raw['MD5Data'] === str_repeat("\x00", 16)) {
+ //$this->warning('MD5Data is null');
+ } else {
+ $info['md5_data_source'] = '';
+ $md5 = $thisfile_takaudio_raw['MD5Data'];
+ for ($i = 0; $i < strlen($md5); $i++) {
+ $info['md5_data_source'] .= str_pad(dechex(ord($md5[$i])), 2, '00', STR_PAD_LEFT);
+ }
+ if (!preg_match('/^[0-9a-f]{32}$/', $info['md5_data_source'])) {
+ unset($info['md5_data_source']);
+ }
+ }
+
+ foreach (array('bits_per_sample', 'version', 'profile') as $key) {
+ if (!empty($thisfile_takaudio[$key])) {
+ $info['audio'][$key] = $thisfile_takaudio[$key];
+ }
+ }
+
+ return true;
+ }
+
+ public function TAKFramesizeLookup($framesize) {
+ static $TAKFramesizeLookup = array(
+ 0 => '94 ms',
+ 1 => '125 ms',
+ 2 => '188 ms',
+ 3 => '250 ms',
+ 4 => '4096 samples',
+ 5 => '8192 samples',
+ 6 => '16384 samples',
+ 7 => '512 samples',
+ 8 => '1024 samples',
+ 9 => '2048 samples'
+ );
+ return (isset($TAKFramesizeLookup[$framesize]) ? $TAKFramesizeLookup[$framesize] : 'invalid');
+ }
+ public function TAKCodecTypeLookup($code) {
+ static $TAKCodecTypeLookup = array(
+ 0 => 'Integer 24 bit (TAK 1.0)',
+ 1 => 'Experimental!',
+ 2 => 'Integer 24 bit (TAK 2.0)',
+ 3 => 'LossyWav (TAK 2.1)',
+ 4 => 'Integer 24 bit MC (TAK 2.2)'
+ );
+ return (isset($TAKCodecTypeLookup[$code]) ? $TAKCodecTypeLookup[$code] : 'invalid');
+ }
+ public function TAKProfileLookup($code) {
+ $out ='-p';
+ $evaluation = ($code & 0xf0) >> 4;
+ $compresion = $code & 0x0f;
+ static $TAKEvaluationLookup = array(
+ 0 => '',
+ 1 => 'e',
+ 2 => 'm'
+ );
+ return (isset($TAKEvaluationLookup[$evaluation]) ? $out .= $compresion . $TAKEvaluationLookup[$evaluation] : 'invalid');
+ }
+
+}
--- /dev/null
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("moment"),require("fullcalendar")):"function"==typeof define&&define.amd?define(["moment","fullcalendar"],t):"object"==typeof exports?t(require("moment"),require("fullcalendar")):t(e.moment,e.FullCalendar)}("undefined"!=typeof self?self:this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=87)}({0:function(t,n){t.exports=e},1:function(e,n){e.exports=t},87:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),n(88);var r=n(1);r.datepickerLocale("be","be",{closeText:"Зачыніць",prevText:"<Папярэд",nextText:"След>",currentText:"Сёння",monthNames:["Студзень","Люты","Сакавік","Красавік","Трав","Чэрвень","Ліпень","Жнівень","Верасень","Кастрычнік","Лістапад","Снежань"],monthNamesShort:["Студ","Лют","Сак","Крас","Трав","Чэрв","Ліп","Жнів","Вер","Каст","Ліст","Снеж"],dayNames:["нядзеля","панядзелак","аўторак","серада","чацвер","пятніца","субота"],dayNamesShort:["ндз","пнд","аўт","срд","чцв","птн","сбт"],dayNamesMin:["Нд","Пн","Ат","Ср","Чц","Пт","Сб"],weekHeader:"Ндз",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}),r.locale("be",{buttonText:{month:"Месяц",week:"Тыдзень",day:"Дзень",list:"Парадак дня"},allDayHtml:"Увесь<br />дзень",eventLimitText:function(e){return"+ яшчэ "+e},noEventsMessage:"Няма падзей для адлюстравання"})},88:function(e,t,n){!function(e,t){t(n(0))}(0,function(e){function t(e,t){var n=e.split("_");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,r){var a={ss:n?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:n?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:n?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===r?n?"хвіліна":"хвіліну":"h"===r?n?"гадзіна":"гадзіну":e+" "+t(a[r],+e)}return e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:n,mm:n,h:n,hh:n,d:"дзень",dd:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})})}})});
\ No newline at end of file
--- /dev/null
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("moment"),require("fullcalendar")):"function"==typeof define&&define.amd?define(["moment","fullcalendar"],t):"object"==typeof exports?t(require("moment"),require("fullcalendar")):t(e.moment,e.FullCalendar)}("undefined"!=typeof self?self:this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=213)}({0:function(t,n){t.exports=e},1:function(e,n){e.exports=t},213:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),n(214);var r=n(1);r.datepickerLocale("zh-hk","zh-HK",{closeText:"關閉",prevText:"<上月",nextText:"下月>",currentText:"今天",monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthNamesShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["周日","周一","周二","周三","周四","周五","周六"],dayNamesMin:["日","一","二","三","四","五","六"],weekHeader:"周",dateFormat:"yy/mm/dd",firstDay:1,isRTL:!1,showMonthAfterYear:!0,yearSuffix:"年"}),r.locale("zh-hk",{buttonText:{month:"月",week:"週",day:"天",list:"活動列表"},allDayText:"整天",eventLimitText:"顯示更多",noEventsMessage:"没有任何活動"})},214:function(e,t,n){!function(e,t){t(n(0))}(0,function(e){return e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;return r<600?"凌晨":r<900?"早上":r<1200?"上午":1200===r?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})})}})});
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Test unitaire de la fonction safehtml
+ * du fichier ./inc/texte_mini.php
+ *
+ * genere automatiquement par TestBuilder
+ * le 2021-05-07 17:43
+ */
+
+ $test = 'safehtml';
+ $remonte = "../";
+ while (!is_dir($remonte."ecrire"))
+ $remonte = "../$remonte";
+ require $remonte.'tests/test.inc';
+ find_in_path("./inc/texte_mini.php",'',true);
+
+ // chercher la fonction si elle n'existe pas
+ if (!function_exists($f='safehtml')){
+ find_in_path("inc/filtres.php",'',true);
+ $f = chercher_filtre($f);
+ }
+
+ //
+ // hop ! on y va
+ //
+ $err = tester_fun($f, essais_safehtml());
+
+ // si le tableau $err est pas vide ca va pas
+ if ($err) {
+ die ('<dl>' . join('', $err) . '</dl>');
+ }
+
+ echo "OK";
+
+
+ function essais_safehtml(){
+ $essais = array (
+ 0 =>
+ array (
+ 0 => '',
+ 1 => '',
+ ),
+ 1 =>
+ array (
+ 0 => '0',
+ 1 => '0',
+ ),
+ 2 =>
+ array (
+ 0 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->https://www.spip.net] https://www.spip.net',
+ 1 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->https://www.spip.net] https://www.spip.net',
+ ),
+ 3 =>
+ array (
+ 0 => 'Un texte avec des entités &<>"',
+ 1 => 'Un texte avec des entités &<>"',
+ ),
+ 4 =>
+ array (
+ 0 => 'Un texte avec des entit&eacute;s echap&eacute; &amp;&lt;&gt;&quot;',
+ 1 => 'Un texte avec des entit&eacute;s echap&eacute; &amp;&lt;&gt;&quot;',
+ ),
+ 5 =>
+ array (
+ 0 => 'Un texte avec des entités numériques &<>"',
+ 1 => 'Un texte avec des entités numériques &<>"',
+ ),
+ 6 =>
+ array (
+ 0 => 'Un texte avec des entit&#233;s num&#233;riques echap&#233;es &#38;&#60;&#62;&quot;',
+ 1 => 'Un texte avec des entit&#233;s num&#233;riques echap&#233;es &#38;&#60;&#62;&quot;',
+ ),
+ 7 =>
+ array (
+ 0 => 'Un texte sans entites &<>"\'',
+ 1 => 'Un texte sans entites &<>"\'',
+ ),
+ 8 =>
+ array (
+ 0 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>',
+ 1 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>',
+ ),
+ 9 =>
+ array (
+ 0 => 'Un modele https://www.spip.net]>',
+ 1 => 'Un modele <modeleinexistant|lien=[->https://www.spip.net]>',
+ ),
+ 10 =>
+ array (
+ 0 => 'Un texte avec des retour
+a la ligne et meme des
+
+paragraphes',
+ 1 => 'Un texte avec des retour
+a la ligne et meme des
+
+paragraphes',
+ ),
+ 11 =>
+ array (
+ 0 => '\';alert(String.fromCharCode(88,83,83))//\\\';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//\\";alert(String.fromCharCode(88,83,83))//-->">\'><code class="echappe-js"><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT></code>=&{}',
+ 1 => '\';alert(String.fromCharCode(88,83,83))//\\\';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//\\";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">\'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>=&{}',
+ ),
+ 12 =>
+ array (
+ 0 => '\'\';!--"<xss>=&{()}</xss>',
+ 1 => '\'\';!--"<XSS>=&{()}',
+ ),
+ 13 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT>alert(\'XSS\')</SCRIPT></code>',
+ 1 => '<SCRIPT>alert(\'XSS\')</SCRIPT>',
+ ),
+ 14 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT></code>',
+ 1 => '<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>',
+ ),
+ 15 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT></code>',
+ 1 => '<SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>',
+ ),
+ 16 =>
+ array (
+ 0 => '<base HREF="javascript:alert(\'XSS\');//">',
+ 1 => '<BASE HREF="javascript:alert(\'XSS\');//">',
+ ),
+ 17 =>
+ array (
+ 0 => '<code class="echappe-js"><BGSOUND SRC="javascript:alert(\'XSS\');"></code>',
+ 1 => '<BGSOUND SRC="javascript:alert(\'XSS\');">',
+ ),
+ 18 =>
+ array (
+ 0 => '<code class="echappe-js"><BODY BACKGROUND="javascript:alert(\'XSS\');"></code>',
+ 1 => '<BODY BACKGROUND="javascript:alert(\'XSS\');">',
+ ),
+ 19 =>
+ array (
+ 0 => '<code class="echappe-js"><BODY ONLOAD=alert(\'XSS\')></code>',
+ 1 => '<BODY ONLOAD=alert(\'XSS\')>',
+ ),
+ 20 =>
+ array (
+ 0 => '<div></div>',
+ 1 => '<DIV STYLE="background-image: url(javascript:alert(\'XSS\'))">',
+ ),
+ 21 =>
+ array (
+ 0 => '<div></div>',
+ 1 => '<DIV STYLE="background-image: url(javascript:alert(\'XSS\'))">',
+ ),
+ 22 =>
+ array (
+ 0 => '<div></div>',
+ 1 => '<DIV STYLE="width: expression(alert(\'XSS\'));">',
+ ),
+ 23 =>
+ array (
+ 0 => '',
+ 1 => '<FRAMESET><FRAME SRC="javascript:alert(\'XSS\');"></FRAMESET>',
+ ),
+ 24 =>
+ array (
+ 0 => '<code class="echappe-js"><IFRAME SRC="javascript:alert(\'XSS\');"></IFRAME></code>',
+ 1 => '<IFRAME SRC="javascript:alert(\'XSS\');"></IFRAME>',
+ ),
+ 25 =>
+ array (
+ 0 => '<input type="IMAGE" />',
+ 1 => '<INPUT TYPE="IMAGE" SRC="javascript:alert(\'XSS\');">',
+ ),
+ 26 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC="javascript:alert(\'XSS\');"></code>',
+ 1 => '<IMG SRC="javascript:alert(\'XSS\');">',
+ ),
+ 27 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC=javascript:alert(\'XSS\')></code>',
+ 1 => '<IMG SRC=javascript:alert(\'XSS\')>',
+ ),
+ 28 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG DYNSRC="javascript:alert(\'XSS\');"></code>',
+ 1 => '<IMG DYNSRC="javascript:alert(\'XSS\');">',
+ ),
+ 29 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG LOWSRC="javascript:alert(\'XSS\');"></code>',
+ 1 => '<IMG LOWSRC="javascript:alert(\'XSS\');">',
+ ),
+ 30 =>
+ array (
+ 0 => '<img src="http://www.thesiteyouareon.com/somecommand.php?somevariables=maliciouscode" />',
+ 1 => '<IMG SRC="http://www.thesiteyouareon.com/somecommand.php?somevariables=maliciouscode">',
+ ),
+ 31 =>
+ array (
+ 0 => 'exp/*<xss style="noxss:noxss("*/pression(alert("XSS"))"></xss>',
+ 1 => 'exp/*<XSS STYLE=\'no\\xss:noxss("*//*");
+xss:ex/*XSS*//*/*/pression(alert("XSS"))\'>',
+ ),
+ 32 =>
+ array (
+ 0 => '<ul><li>XSS</li></ul>',
+ 1 => '<STYLE>li {list-style-image: url("javascript:alert(\'XSS\')");}</STYLE><UL><LI>XSS',
+ ),
+ 33 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC=\'vbscript:msgbox("XSS")\'></code>',
+ 1 => '<IMG SRC=\'vbscript:msgbox("XSS")\'>',
+ ),
+ 34 =>
+ array (
+ 0 => '',
+ 1 => '<LAYER SRC="http://ha.ckers.org/scriptlet.html"></LAYER>',
+ ),
+ 35 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC="livescript:[code]"></code>',
+ 1 => '<IMG SRC="livescript:[code]">',
+ ),
+ 36 =>
+ array (
+ 0 => '¼script¾alert(¢XSS¢)¼/script¾',
+ 1 => '¼script¾alert(¢XSS¢)¼/script¾',
+ ),
+ 37 =>
+ array (
+ 0 => '<code class="echappe-js"><META HTTP-EQUIV="refresh" CONTENT="0;url=javascript:alert(\'XSS\');"></code>',
+ 1 => '<META HTTP-EQUIV="refresh" CONTENT="0;url=javascript:alert(\'XSS\');">',
+ ),
+ 38 =>
+ array (
+ 0 => '<code class="echappe-js"><META HTTP-EQUIV="refresh" CONTENT="0;url=data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K"></code>',
+ 1 => '<META HTTP-EQUIV="refresh" CONTENT="0;url=data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K">',
+ ),
+ 39 =>
+ array (
+ 0 => '<code class="echappe-js"><META HTTP-EQUIV="refresh" CONTENT="0; URL=http://;URL=javascript:alert(\'XSS\');"></code>',
+ 1 => '<META HTTP-EQUIV="refresh" CONTENT="0; URL=http://;URL=javascript:alert(\'XSS\');">',
+ ),
+ 40 =>
+ array (
+ 0 => '<img />',
+ 1 => '<IMG SRC="mocha:[code]">',
+ ),
+ 41 =>
+ array (
+ 0 => '',
+ 1 => '<OBJECT TYPE="text/x-scriptlet" DATA="http://ha.ckers.org/scriptlet.html"></OBJECT>',
+ ),
+ 42 =>
+ array (
+ 0 => '<code class="echappe-js"><OBJECT classid=clsid:ae24fdae-03c6-11d1-8b76-0080c744f389><param name=url value=javascript:alert(\'XSS\')></OBJECT></code>',
+ 1 => '<OBJECT classid=clsid:ae24fdae-03c6-11d1-8b76-0080c744f389><param name=url value=javascript:alert(\'XSS\')></OBJECT>',
+ ),
+ 43 =>
+ array (
+ 0 => '',
+ 1 => '<EMBED SRC="http://ha.ckers.org/xss.swf" AllowScriptAccess="always"></EMBED>',
+ ),
+ 44 =>
+ array (
+ 0 => '',
+ 1 => '<STYLE TYPE="text/javascript">alert(\'XSS\');</STYLE>',
+ ),
+ 45 =>
+ array (
+ 0 => '<img />',
+ 1 => '<IMG STYLE="xss:expr/*XSS*/ession(alert(\'XSS\'))">',
+ ),
+ 46 =>
+ array (
+ 0 => '<xss></xss>',
+ 1 => '<XSS STYLE="xss:expression(alert(\'XSS\'))">',
+ ),
+ 47 =>
+ array (
+ 0 => '<a class="XSS"></a>',
+ 1 => '<STYLE>.XSS{background-image:url("javascript:alert(\'XSS\')");}</STYLE><A CLASS=XSS></A>',
+ ),
+ 48 =>
+ array (
+ 0 => '',
+ 1 => '<STYLE type="text/css">BODY{background:url("javascript:alert(\'XSS\')")}</STYLE>',
+ ),
+ 49 =>
+ array (
+ 0 => '',
+ 1 => '<LINK REL="stylesheet" HREF="javascript:alert(\'XSS\');">',
+ ),
+ 50 =>
+ array (
+ 0 => '',
+ 1 => '<LINK REL="stylesheet" HREF="http://ha.ckers.org/xss.css">',
+ ),
+ 51 =>
+ array (
+ 0 => '',
+ 1 => '<STYLE>@import\'http://ha.ckers.org/xss.css\';</STYLE>',
+ ),
+ 52 =>
+ array (
+ 0 => '',
+ 1 => '<META HTTP-EQUIV="Link" Content="<http://ha.ckers.org/xss.css>; REL=stylesheet">',
+ ),
+ 53 =>
+ array (
+ 0 => '',
+ 1 => '<STYLE>BODY{-moz-binding:url("http://ha.ckers.org/xssmoz.xml#xss")}</STYLE>',
+ ),
+ 54 =>
+ array (
+ 0 => '<table></table>',
+ 1 => '<TABLE BACKGROUND="javascript:alert(\'XSS\')"></TABLE>',
+ ),
+ 55 =>
+ array (
+ 0 => '<table><td></td></table>',
+ 1 => '<TABLE><TD BACKGROUND="javascript:alert(\'XSS\')"></TD></TABLE>',
+ ),
+ 56 =>
+ array (
+ 0 => '
+<?import namespace="xss" implementation="http://ha.ckers.org/xss.htc">
+XSS
+
+',
+ 1 => '<HTML xmlns:xss>
+<?import namespace="xss" implementation="http://ha.ckers.org/xss.htc">
+<xss:xss>XSS</xss:xss>
+
+</HTML>',
+ ),
+ 57 =>
+ array (
+ 0 => '<span></span>',
+ 1 => '<XML ID=I><X><C><![CDATA[<IMG SRC="javas]]><![CDATA[cript:alert(\'XSS\');">]]>
+
+</C></X></xml><SPAN DATASRC=#I DATAFLD=C DATAFORMATAS=HTML>',
+ ),
+ 58 =>
+ array (
+ 0 => '
+
+<span></span>',
+ 1 => '<XML ID="xss"><I><B><IMG SRC="javas<!-- -->cript:alert(\'XSS\')"></B></I></XML>
+
+<SPAN DATASRC="#xss" DATAFLD="B" DATAFORMATAS="HTML"></SPAN>',
+ ),
+ 59 =>
+ array (
+ 0 => '
+<span></span>',
+ 1 => '<XML SRC="http://ha.ckers.org/xsstest.xml" ID=I></XML>
+<SPAN DATASRC=#I DATAFLD=C DATAFORMATAS=HTML></SPAN>',
+ ),
+ 60 =>
+ array (
+ 0 => '
+<?xml:namespace prefix="t" ns="urn:schemas-microsoft-com:time">
+
+<?import namespace="t" implementation="#default#time2">
+<SCRIPT DEFER>alert(\'XSS\')</SCRIPT>"> ',
+ 1 => '<HTML><BODY>
+<?xml:namespace prefix="t" ns="urn:schemas-microsoft-com:time">
+
+<?import namespace="t" implementation="#default#time2">
+<t:set attributeName="innerHTML" to="XSS<SCRIPT DEFER>alert(\'XSS\')</SCRIPT>"> </BODY></HTML>',
+ ),
+ 61 =>
+ array (
+ 0 => '',
+ 1 => '<!--[if gte IE 4]>
+<SCRIPT>alert(\'XSS\');</SCRIPT>
+<![endif]-->',
+ ),
+ 62 =>
+ array (
+ 0 => '<SCRIPT>alert(\'XSS\')</SCRIPT>">',
+ 1 => '<META HTTP-EQUIV="Set-Cookie" Content="USERID=<SCRIPT>alert(\'XSS\')</SCRIPT>">',
+ ),
+ 63 =>
+ array (
+ 0 => '<xss></xss>',
+ 1 => '<XSS STYLE="behavior: url(http://ha.ckers.org/xss.htc);">',
+ ),
+ 64 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT SRC="http://ha.ckers.org/xss.jpg"></SCRIPT></code>',
+ 1 => '<SCRIPT SRC="http://ha.ckers.org/xss.jpg"></SCRIPT>',
+ ),
+ 65 =>
+ array (
+ 0 => '',
+ 1 => '<!--#exec cmd="/bin/echo \'<SCRIPT SRC\'"--><!--#exec cmd="/bin/echo \'=http://ha.ckers.org/xss.js></SCRIPT>\'"-->',
+ ),
+ 66 =>
+ array (
+ 0 => '<? echo(\'alert("XSS")\'); ?>',
+ 1 => '<? echo(\'<SCR)\';
+echo(\'IPT>alert("XSS")</SCRIPT>\'); ?>',
+ ),
+ 67 =>
+ array (
+ 0 => '<br size="&{alert(\'XSS\')}" />',
+ 1 => '<BR SIZE="&{alert(\'XSS\')}">',
+ ),
+ 68 =>
+ array (
+ 0 => '<
+%3C
+<
+<
+<
+<
+<
+<
+<
+
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+
+<
+<
+<
+<
+<
+<
+\\x3c
+\\x3C
+\\u003c
+\\u003C',
+ 1 => '<
+%3C
+<
+<
+<
+<
+<
+<
+<
+
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+<
+
+<
+<
+<
+<
+<
+<
+\\x3c
+\\x3C
+\\u003c
+\\u003C',
+ ),
+ 69 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC=JaVaScRiPt:alert(\'XSS\')></code>',
+ 1 => '<IMG SRC=JaVaScRiPt:alert(\'XSS\')>',
+ ),
+ 70 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC=javascript:alert(&quot;XSS&quot;)></code>',
+ 1 => '<IMG SRC=javascript:alert("XSS")>',
+ ),
+ 71 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC=`javascript:alert("RSnake says, \'XSS\'")`></code>',
+ 1 => '<IMG SRC=`javascript:alert("RSnake says, \'XSS\'")`>',
+ ),
+ 72 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC=javascript:alert(String.fromCharCode(88,83,83))></code>',
+ 1 => '<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>',
+ ),
+ 73 =>
+ array (
+ 0 => '<img />',
+ 1 => '<IMG SRC=javascript:alert('XSS')>',
+ ),
+ 74 =>
+ array (
+ 0 => '<img />',
+ 1 => '<IMG SRC=javascript:alert('XSS')>',
+ ),
+ 75 =>
+ array (
+ 0 => '<div style="background-image:00750072006C0028\'006a006100760061007300630072006900700074003a0061006c0065007200740028.10270058.1053005300270029\'0029"></div>',
+ 1 => '<DIV STYLE="background-image:\\0075\\0072\\006C\\0028\'\\006a\\0061\\0076\\0061\\0073\\0063\\0072\\0069\\0070\\0074\\003a\\0061\\006c\\0065\\0072\\0074\\0028.1027\\0058.1053\\0053\\0027\\0029\'\\0029">',
+ ),
+ 76 =>
+ array (
+ 0 => '<img />',
+ 1 => '<IMG SRC=javascript:alert('XSS')>',
+ ),
+ 77 =>
+ array (
+ 0 => ' ',
+ 1 => '<HEAD><META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-7"> </HEAD>+ADw-SCRIPT+AD4-alert(\'XSS\');+ADw-/SCRIPT+AD4-',
+ ),
+ 78 =>
+ array (
+ 0 => '\\";alert(\'XSS\');//',
+ 1 => '\\";alert(\'XSS\');//',
+ ),
+ 79 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT>alert("XSS");</SCRIPT></code>',
+ 1 => '</TITLE><SCRIPT>alert("XSS");</SCRIPT>',
+ ),
+ 80 =>
+ array (
+ 0 => '',
+ 1 => '<STYLE>@im\\port\'\\ja\\vasc\\ript:alert("XSS")\';</STYLE>',
+ ),
+ 81 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC="jav ascript:alert(\'XSS\');"></code>',
+ 1 => '<IMG SRC="jav ascript:alert(\'XSS\');">',
+ ),
+ 82 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC="jav&#x09;ascript:alert(\'XSS\');"></code>',
+ 1 => '<IMG SRC="jav	ascript:alert(\'XSS\');">',
+ ),
+ 83 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC="jav&#x0A;ascript:alert(\'XSS\');"></code>',
+ 1 => '<IMG SRC="jav
ascript:alert(\'XSS\');">',
+ ),
+ 84 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC="jav&#x0D;ascript:alert(\'XSS\');"></code>',
+ 1 => '<IMG SRC="jav
ascript:alert(\'XSS\');">',
+ ),
+ 85 =>
+ array (
+ 0 => '<img />\r',
+ 1 => '<IMG\rSRC\r=\r"\rj\ra\rv\ra\rs\rc\rr\ri\rp\rt\r:\ra\rl\re\rr\rt\r(\r\'\rX\rS\rS\r\'\r)\r"\r>\r',
+ ),
+ 86 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC=java' . "\0" . 'script:alert("XSS")></code>',
+ 1 => '<IMG SRC=java' . "\0" . 'script:alert("XSS")>',
+ ),
+ 87 =>
+ array (
+ 0 => '&alert("XSS")',
+ 1 => '&<SCR' . "\0" . 'IPT>alert("XSS")</SCR' . "\0" . 'IPT>',
+ ),
+ 88 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC=" &#14; javascript:alert(\'XSS\');"></code>',
+ 1 => '<IMG SRC="  javascript:alert(\'XSS\');">',
+ ),
+ 89 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT/XSS SRC="http://ha.ckers.org/xss.js"></SCRIPT></code>',
+ 1 => '<SCRIPT/XSS SRC="http://ha.ckers.org/xss.js"></SCRIPT>',
+ ),
+ 90 =>
+ array (
+ 0 => '|\\]^`=alert("XSS")>',
+ 1 => '<BODY onload!#$%&()*~+-_.,:;?@[/|\\]^`=alert("XSS")>',
+ ),
+ 91 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT SRC=http://ha.ckers.org/xss.js</code>',
+ 1 => '<SCRIPT SRC=http://ha.ckers.org/xss.js',
+ ),
+ 92 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT SRC=//ha.ckers.org/.j></code>',
+ 1 => '<SCRIPT SRC=//ha.ckers.org/.j>',
+ ),
+ 93 =>
+ array (
+ 0 => '<code class="echappe-js"><IMG SRC="javascript:alert(\'XSS\')"</code>',
+ 1 => '<IMG SRC="javascript:alert(\'XSS\')"',
+ ),
+ 94 =>
+ array (
+ 0 => '',
+ 1 => '<IFRAME SRC=http://ha.ckers.org/scriptlet.html <',
+ ),
+ 95 =>
+ array (
+ 0 => '<<code class="echappe-js"><SCRIPT>alert("XSS");//<</SCRIPT></code>',
+ 1 => '<<SCRIPT>alert("XSS");//<</SCRIPT>',
+ ),
+ 96 =>
+ array (
+ 0 => '<img /><code class="echappe-js"><SCRIPT>alert("XSS")</SCRIPT></code>">',
+ 1 => '<IMG """><SCRIPT>alert("XSS")</SCRIPT>">',
+ ),
+ 97 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT>a=/XSS/<br />
+alert(a.source)</SCRIPT></code>',
+ 1 => '<SCRIPT>a=/XSS/
+alert(a.source)</SCRIPT>',
+ ),
+ 98 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT a=">" SRC="http://ha.ckers.org/xss.js"></SCRIPT></code>',
+ 1 => '<SCRIPT a=">" SRC="http://ha.ckers.org/xss.js"></SCRIPT>',
+ ),
+ 99 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT ="blah" SRC="http://ha.ckers.org/xss.js"></SCRIPT></code>',
+ 1 => '<SCRIPT ="blah" SRC="http://ha.ckers.org/xss.js"></SCRIPT>',
+ ),
+ 100 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT a="blah" \'\' SRC="http://ha.ckers.org/xss.js"></SCRIPT></code>',
+ 1 => '<SCRIPT a="blah" \'\' SRC="http://ha.ckers.org/xss.js"></SCRIPT>',
+ ),
+ 101 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT "a=\'>\'" SRC="http://ha.ckers.org/xss.js"></SCRIPT></code>',
+ 1 => '<SCRIPT "a=\'>\'" SRC="http://ha.ckers.org/xss.js"></SCRIPT>',
+ ),
+ 102 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT a=`>` SRC="http://ha.ckers.org/xss.js"></SCRIPT></code>',
+ 1 => '<SCRIPT a=`>` SRC="http://ha.ckers.org/xss.js"></SCRIPT>',
+ ),
+ 103 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT>document.write("<SCRI");</SCRIPT></code>PT SRC="http://ha.ckers.org/xss.js">',
+ 1 => '<SCRIPT>document.write("<SCRI");</SCRIPT>PT SRC="http://ha.ckers.org/xss.js"></SCRIPT>',
+ ),
+ 104 =>
+ array (
+ 0 => '<code class="echappe-js"><SCRIPT a=">\'>" SRC="http://ha.ckers.org/xss.js"></SCRIPT></code>',
+ 1 => '<SCRIPT a=">\'>" SRC="http://ha.ckers.org/xss.js"></SCRIPT>',
+ ),
+ 105 =>
+ array (
+ 0 => '<a href="http://66.102.7.147/">XSS</a>',
+ 1 => '<A HREF="http://66.102.7.147/">XSS</A>',
+ ),
+ 106 =>
+ array (
+ 0 => '<a href="http://%77%77%77%2E%67%6F%6F%67%6C%65%2E%63%6F%6D">XSS</a>',
+ 1 => '<A HREF="http://%77%77%77%2E%67%6F%6F%67%6C%65%2E%63%6F%6D">XSS</A>',
+ ),
+ 107 =>
+ array (
+ 0 => '<a href="http://1113982867/">XSS</a>',
+ 1 => '<A HREF="http://1113982867/">XSS</A>',
+ ),
+ 108 =>
+ array (
+ 0 => '<a href="http://0x42.0x0000066.0x7.0x93/">XSS</a>',
+ 1 => '<A HREF="http://0x42.0x0000066.0x7.0x93/">XSS</A>',
+ ),
+ 109 =>
+ array (
+ 0 => '<a href="http://0102.0146.0007.00000223/">XSS</a>',
+ 1 => '<A HREF="http://0102.0146.0007.00000223/">XSS</A>',
+ ),
+ 110 =>
+ array (
+ 0 => '<a>XSS</a>',
+ 1 => '<A HREF="h
+tt p://6	6.000146.0x7.147/">XSS</A>',
+ ),
+ 111 =>
+ array (
+ 0 => '<a href="//www.google.com/">XSS</a>',
+ 1 => '<A HREF="//www.google.com/">XSS</A>',
+ ),
+ 112 =>
+ array (
+ 0 => '<a href="//google">XSS</a>',
+ 1 => '<A HREF="//google">XSS</A>',
+ ),
+ 113 =>
+ array (
+ 0 => '<a href="http://ha.ckers.org@google">XSS</a>',
+ 1 => '<A HREF="http://ha.ckers.org@google">XSS</A>',
+ ),
+ 114 =>
+ array (
+ 0 => '<a href="http://google:ha.ckers.org">XSS</a>',
+ 1 => '<A HREF="http://google:ha.ckers.org">XSS</A>',
+ ),
+ 115 =>
+ array (
+ 0 => '<a href="http://google.com/">XSS</a>',
+ 1 => '<A HREF="http://google.com/">XSS</A>',
+ ),
+ 116 =>
+ array (
+ 0 => '<a href="http://www.google.com./">XSS</a>',
+ 1 => '<A HREF="http://www.google.com./">XSS</A>',
+ ),
+ 117 =>
+ array (
+ 0 => '<a>XSS</a>',
+ 1 => '<A HREF="javascript:document.location=\'http://www.google.com/\'">XSS</A>',
+ ),
+ 118 =>
+ array (
+ 0 => '<a href="http://www.gohttp://www.google.com/ogle.com/">XSS</a>',
+ 1 => '<A HREF="http://www.gohttp://www.google.com/ogle.com/">XSS</A>',
+ ),
+ 119 =>
+ array (
+ 0 => '<span class="montant" data-montant-nombre="100" data-montant-devise="EUR"></span>',
+ 1 => '<span class="montant" data-montant-nombre="100" data-montant-devise="EUR">',
+ ),
+);
+ return $essais;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+