Alle Kategorien:
  E V T Z Allgemein
 EVTZ-Datenbank
  E V T Z Dokumente
 Kommentare
 Literaturdatenbank
  E V T Z Literatur2003
  E V T Z Literatur2004
  E V T Z Literatur2005
  E V T Z Literatur2006
  E V T Z Literatur2007
  E V T Z Literatur2008
  E V T Z Literatur2009
  E V T Z Literatur2010
  E V T Z Literatur2011
  E V T Z Literatur2012
  E V T Z Literatur2013
  E V T Z Literatur2014
  E V T Z Literatur2015
  E V T Z Literatur2016
  E V T Z Literatur2017
  E V T Z Literatur2018
  E V T Z Literatur2019
  E V T Z Literatur A
  E V T Z Literatur Arbe...
  E V T Z Literatur B
  E V T Z Literatur C
  E V T Z Literatur D
  E V T Z Literatur Deut...
  E V T Z Literatur E
  E V T Z Literatur E C ...
  E V T Z Literatur Engl...
  E V T Z Literatur F
  E V T Z Literatur Fran...
  E V T Z Literatur G
  E V T Z Literatur Gesu...
  E V T Z Literatur H
  E V T Z Literatur I
  E V T Z Literatur Ital...
  E V T Z Literatur J
  E V T Z Literatur K
  E V T Z Literatur L
  E V T Z Literatur M
  E V T Z Literatur Mult...
  E V T Z Literatur N
  E V T Z Literatur O
  E V T Z Literatur P
  E V T Z Literatur Poli...
  Adamczuk2013
  Adamczuk2015
  Adamczyk Gierczak2007
  Balogh Pete2018
  Beck2012
  Beck2013
  Beck2015
  Beck2017
  Beck2018
  Branda2009
  Brehm2012
  Brock Albert1995
  C E S C I Balkans2017
  Caesar2012
 Literaturdatenbank
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  Adamczuk2013
  Balogh Pete2018
  Beck2012
  Beck2013
  Beck2015
  Beck2018
  Berzi2013
  Berzi2017a
  Berzi2017b
  Biot2012
  Biot2013a
  Brehm2012
  C E S C I Bal...
  C E S C I Leg...
  Caesar2012
  Caesar2017
 Literaturdatenbank
  Cavallo Diani...
  Coen2010
  Cojanu Robu2014
  Commission2016
  Commission2016a
  Cresatti2010
  Cucu2011
  De Sousa2013
  Decoville Dur...
  Dizdarevic2011
  Duindam Waddi...
  Dura2018
  Dühr Nadin2007
  Engl2007
  Engl2016
  Engl Evrard2019
  Engstroem2011
  Evrard2016
  Evrard2017
  Evrard Engl2018
  Fabbro Hasels...
  Footman2014
  G O E F P2018
  Gasparini Et ...
  Glinos Wismar...
  Gola2011
  Gonzalez2013
  Gyelnik2016
  Jaansoo Groen...
  Jacob Suchet2...
  Janczak2016
  Janssen2007a
  Janssen2009
  Kortese2018
  Ladysz2011b
  Lange2012
  Malatinec Kyj...
  Martinez2014
  Martinez2014b
  Małkowska2016
  Medeiros2014
  Medeiros2015
  Medeiros2018
  Medeiros2018a
  Medeiros2019
  Metis2009
  Nadalutti2013
  Niesten2019
  Oszter2019
  Persson2013
  Popoviciu Toc...
  Portolés2015
  Proto2008
  Pucher2015
  Pucher2016
  Pucher Hamza2...
  Pucher Radzyn...
  Randier2009
  Repullo2014
  Ricci2011
  Roura2013
  Răducanu2013
  Saalbach2016
  Sanguin2013
  Sanjuan Gil2013
  Sararu2014
  Sielker2018
  Soos2012
  Soos2013
  Spinaci Vara ...
  Studzieniecki...
  Studzieniecki...
  Svensson2015
  Svensson2016
  Svensson2017
  Tanaka2017
  Telle Svensso...
  Toca2013
  Trifiletti2012
  Ulrich2012
  Ulrich2016a
  Ulrich2016b
  Ulrich2019
  Zillmer2015a
  Zillmer2018
  Zillmer Topts...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Literatu...
  E V T Z Urteile
  E V T Z Vergaber...
  M O T2013
 Startseite
  Cresatti2010
  Cucu2011
  Decoville Durand Fe...
  Dizdarevic2011
  Drab Kledzik2009
  Dumala2009
  Dumala2009a
  Dumala2012
  D´ Ettorre2018
  Engl2007
  Engl2017a
  Engl Evrard2019
  Fic Fic2013
  Galuszka2010
  Gasparini Et Al2011
  Gembiak2013
  Gola2011
  Grosse2012
  Guillermo Ramirez2013
  Gyelnik2016
  Hofericova2013
  Janczak2016
  Janczak2017a
  Jankowski2013
  Joskowiak2013
  Kawalko2015
  Klotz Trettel2016
  Klotz Trettel2017
  Kozak2013
  Martinez2013
  Małkowska2016
  Medeiros2015
  Medeiros2018
  Medeiros2018a
  Medeiros2019
  Nevlazla2013
  Neyer2017
  Ocskay2013
  Pfeil2011
  Popoviciu Toca2011
  Pyrgiel2013
  Riou2010
  Ruszkowski2013
  Sanguin2013
  Sałamacha2018
  Sielker2016
  Sielker2018
  Soos2012
  Spinaci Vara Arriba...
  Svensson2017
  Szymanski2013
  Tanaka2017
  Trifiletti2012
  Ulrich2012
  Ulrich2015
  Ulrich2016
  Ulrich2016a
  Ulrich2016b
  Ulrich2017a
  Wiechmann2017
  Witt2003
  Zdunczuk Studnicka2...
  E V T Z Literatur Poln...
  E V T Z Literatur R
  E V T Z Literatur Raum...
  E V T Z Literatur Raum...
  E V T Z Literatur S
  E V T Z Literatur Slow...
  E V T Z Literatur Span...
  E V T Z Literatur T
  E V T Z Literatur U
  E V T Z Literatur V
  E V T Z Literatur W
  E V T Z Literatur Z
  E V T Z Literatur Zeit...
  E V T Z Urteile
  E V T Z Vergaberecht
  M O T2013
 Startseite
  E V T Z Praxis
 Rechtsprechungsdatenbank
 Rechtsvorschriften
  Kooperationsinstrumente
 Startseite

Version [3852]

Dies ist eine alte Version von WikkaWikiSafeHTML erstellt von WojciechLisiewicz am 2022-07-08 14:57:41.

 

WikkaWiki => SafeHTML

Umstellung von alter PHP-Version

Meldung:
Fatal error: Uncaught Error: Attempt to modify property "handler_default" on null in /usr/local/www/wdb/3rdparty/core/safehtml/classes/HTMLSax.php:556... und noch viel länger (statt 556 auch 494)

Lösung: nicht so einfach...

A. Neuere Version von safehtml nehmen
Bei WackoWiki wird SafeHTML wohl entwickelt. Der Versuch, die neueste Version von dort in 1.4.2 zu integrieren, schlug fehl. Deshalb sind die nachstehend genannten Schritte obsolet => Lösung weiter unten!
Einbindung neuer Version - einzelne Schritte:

1. Neue Version bei Wacko-Wiki geholt
2. Unter 3rdparty/core/safehtml/ gespeichert
3. Änderungen bei Einbindung:

in libs / wakka.class.php:
=> function ReturnSafeHTML($html) ab ca. Zeile 712

in wikka.config.php:
=> 'safehtml_path' => '3rdparty/safehtml', (ca. Zeile 35)
(Pfad auf neue Version geändert)

in 3rdparty / safehtml / safehtml.php
=> alle includes wurden direkt eingespeichert (HTMLSax3, Decorate, States)




Nach Erläuterung bei Wacko-Wiki wird es so eingebunden:
<b>Example:</b>
$parser = new SafeHTML;
$result = $parser->parse($doc);

Benötigt wird aber auch HTMLSax3 - mit folgenden Dateien:
_HTMLSax3
|_HTMLSax3.php
|_HTMLSax3
|_Decorators.php
|_States.php



B. Wie wird SafeHTML in WikkaWiki allgemein eingebunden

Folgende Dateien sind betroffen / hier taucht ein Verweis darauf auf:

Variablen:
  • wikka.php
  • wikka.config.php

Funktionen werden aufgerufen:
  • formatters / wakka.php (2x)
  • formatters / html.php (2x)
  • libs / Wakka.class.php (viele)
  • actions / rss / rss.php
  • actions / image / image.php
  • actions / files / files.php
  • actions / googleform / googleform.php
  • actions / textsearchexpanded / textsearchexpanded.php

Sonstige:


Ergebnis von grep -r -i "safehtml" wdb:
wdb/wikka.php: 'safehtml_path' => '3rdparty/core/safehtml',
wdb/wikka.config.php: 'safehtml_path' => '3rdparty/core/safehtml',
wdb/setup/inc/db_update_mysql.php: rmdirr("safehtml");
wdb/formatters/wakka.php: SafeHTML will treat this but 'raw' may end up with invalid code!
wdb/formatters/wakka.php: return $wakka->ReturnSafeHTML($newembedded);
wdb/formatters/html.php:
SafeHTML will treat this but 'raw' may end up with invalid code!
wdb/formatters/html.php: return $wakka->ReturnSafeHTML($newembedded);
wdb/libs/Wakka.class.php: * @uses Config::$safehtml_path
wdb/libs/Wakka.class.php: * @uses SafeHTML::parse()
wdb/libs/Wakka.class.php: function ReturnSafeHTML($html)
wdb/libs/Wakka.class.php: $safehtml_classpath = $this->GetConfigValue('safehtml_path').'/classes/safehtml.php';
wdb/libs/Wakka.class.php: require_once $safehtml_classpath;
wdb/libs/Wakka.class.php: $safehtml = instantiate('safehtml');
wdb/libs/Wakka.class.php: $filtered_output = $safehtml->parse($html);
wdb/libs/Wakka.class.php.save: * @uses Config::$safehtml_path
wdb/libs/Wakka.class.php.save: * @uses SafeHTML::parse()
wdb/libs/Wakka.class.php.save: function ReturnSafeHTML($html)
wdb/libs/Wakka.class.php.save: #print $safehtml_classpath;
wdb/libs/Wakka.class.php.save: #$safehtml = instantiate('safehtml');
wdb/libs/Wakka.class.php.save: #$filtered_output = $safehtml->parse($html);
wdb/libs/Wakka.class.php.save: $safehtml_classpath = $this->GetConfigValue('safehtml_path').DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR.'safehtml.php';
wdb/libs/Wakka.class.php.save: require_once $safehtml_classpath;
wdb/libs/Wakka.class.php.save: $safehtml = instantiate('safehtml');
wdb/libs/Wakka.class.php.save: $filtered_output = $safehtml->parse($html);
wdb/lang/pl/defaults/FormattingRules.txt:Domyślnie niektóre polecenia HTML są usuwane, celem zabezpieczenia przed potencjalnie niebezpiecznym kodem. Więcej informacji na ten temat: Wikka:SafeHTML.
wdb/lang/en/defaults/FormattingRules.php:printf(T_('By default, some HTML tags are removed by the %s parser to protect against potentially dangerous code. The list of tags that are stripped can be found on the %s page.'), 'SafeHTML', 'Wikka:SafeHTML');
wdb/actions/rss/rss.php: * @uses Wakka::ReturnSafeHTML()
wdb/actions/rss/rss.php: echo $this->ReturnSafeHTML($cached_output);
wdb/actions/image/image.php:wdb/actions/table/table.php: * @uses Wakka::ReturnSafeHTML()
wdb/actions/table/table.php: echo $this->ReturnSafeHTML($cached_output);
wdb/actions/googleform/googleform.php: Sanitization: Passing $query to htmlspecialchars_ent instead of ReturnSafeHTML(). Inside the value parameter of the input field,
wdb/actions/files/files.php: * @uses Wakka::ReturnSafeHTML()
wdb/actions/files/files.php:
Although $output is passed to ReturnSafeHTML, it's better to sanitize $text here. At least it can avoid invalid XHTML.
wdb/actions/files/files.php: $output = $this->ReturnSafeHTML($output);
wdb/actions/files/files.php: $output = $this->ReturnSafeHTML($output);
wdb/actions/textsearchexpanded/textsearchexpanded.php: * @uses Wakka::ReturnSafeHtml()
wdb/actions/textsearchexpanded/textsearchexpanded.php:$result_page_list = $this->ReturnSafeHtml($result_page_list);
wdb/3rdparty/core/safehtml/classes/HTMLSax_old.php: If you'll use unmodified HTMLSax, Safehtml will be NOT SAFE!
wdb/3rdparty/core/safehtml/classes/safehtml.php: SafeHTML Parser.
wdb/3rdparty/core/safehtml/classes/safehtml.php: http://pixel-apes.com/safehtml
wdb/3rdparty/core/safehtml/classes/safehtml.php:class safehtml {
wdb/3rdparty/core/safehtml/classes/safehtml.php: function safehtml() {
wdb/3rdparty/core/safehtml/classes/HTMLSax.php: If you'll use unmodified HTMLSax, Safehtml will be NOT SAFE!
wdb/3rdparty/core/safehtml/readme.txt:SafeHTML
wdb/3rdparty/core/safehtml/readme.txt:http://pixel-apes.com/safehtml
wdb/3rdparty/core/safehtml/readme.txt:Please, subscribe to http://pixel-apes.com/safehtml/feed/rss feed in order to receive notices
wdb/3rdparty/core/safehtml/readme.txt:when SAFEHTML will be updated.
wdb/3rdparty/core/safehtml/readme.txt: * New array, closeParagraph, contains list of block-level elements. When we open such elemet, we should close paragraph before. . It allows SafeHTML to produce more XHTML compliant code.
wdb/3rdparty/core/safehtml/readme.txt: * Now SafeHTML strips down table elements when we are not inside table.
wdb/3rdparty/core/safehtml/readme.txt: * Now SafeHTML correctly closes unclosed "li" tags: before opening "li" of the same nesting level.
wdb/3rdparty/core/safehtml/readme.txt: Bug fix: safehtml hangs on <style></style></style> code.
Binary file wdb/sql/wikka_sqlite3.db matches



C. Zweiter Anlauf mit Verbesserung des ursprünglichen Codes
Dieser Versuch war erfolgreich:

1. Code für Klassen verbessert
Die meisten Stellen können mit dem Tool rector korrigiert werden.

=> es mussten Konstruktoren in allen Klassen neu geschrieben werden und
=> ferner einige Deklarationen von Arrays

2. Problem des Konstruktors bei Vererbung!
Nach Umsetzung der standardmäßigen Korrekturen (Vorschlag rector) kam immer noch ein Fehler bei ca. Zeile 300 in der Funktion _parse($state = XML_HTMLSAX_STATE_START) => $state = $this->State[$state]->parse($this);.

offenschtliches Problem:

Die Klassen, die von der Klasse XML_HTMLSax_StateParser in HTMLSax.php abgeleitet werden (=> XML_HTMLSax_StateParser_Gtet430 und - eigentlich obsolet - XML_HTMLSax_StateParser_Lt430)

Lösung:
explizit die Konstruktion-Routine aufrufen:
parent::__construct($htmlsax);


Auf dieser Seite sind keine Kommentare vorhanden