diff --git a/htdocs/composer.json b/htdocs/composer.json index 53a5d57b..e2056bc7 100644 --- a/htdocs/composer.json +++ b/htdocs/composer.json @@ -9,7 +9,8 @@ "symfony/dependency-injection": "dev-master", "symfony/yaml": "dev-master", "symfony/config": "dev-master", - "ccampbell/chromephp": "dev-master" + "ccampbell/chromephp": "dev-master", + "html2text/html2text": "dev-master" }, "autoload": { "psr-4": { "": "lib/" }, diff --git a/htdocs/composer.lock b/htdocs/composer.lock index 307f943e..6ec5f530 100644 --- a/htdocs/composer.lock +++ b/htdocs/composer.lock @@ -3,7 +3,7 @@ "This file locks the dependencies of your project to a known state", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" ], - "hash": "480b83d0fda088d1cec81d930c5d4754", + "hash": "d857a06bd833ddddbe3148052e35b7cc", "packages": [ { "name": "ccampbell/chromephp", @@ -93,6 +93,36 @@ ], "time": "2013-02-18 00:04:08" }, + { + "name": "html2text/html2text", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/mtibben/html2text.git", + "reference": "2a78b855d82953c1e3bd39bc46d17fdccf68025f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mtibben/html2text/zipball/2a78b855d82953c1e3bd39bc46d17fdccf68025f", + "reference": "2a78b855d82953c1e3bd39bc46d17fdccf68025f", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "~3.7" + }, + "type": "library", + "autoload": { + "psr-0": { + "Html2Text": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPLv2" + ], + "description": "Converts HTML to formatted plain text", + "time": "2013-12-26 04:38:06" + }, { "name": "ocpl/okapi", "version": "dev-master", @@ -341,7 +371,8 @@ "symfony/dependency-injection": 20, "symfony/yaml": 20, "symfony/config": 20, - "ccampbell/chromephp": 20 + "ccampbell/chromephp": 20, + "html2text/html2text": 20 }, "platform": { "php": ">=5.3.0" diff --git a/htdocs/lib/clicompatbase.inc.php b/htdocs/lib/clicompatbase.inc.php index f42a533e..76a32c31 100644 --- a/htdocs/lib/clicompatbase.inc.php +++ b/htdocs/lib/clicompatbase.inc.php @@ -24,16 +24,6 @@ global $interface_output, $dblink_slave; if (!isset($interface_output)) $interface_output = 'plain'; - if (isset($opt['rootpath'])) - $rootpath = $opt['rootpath']; - else if (isset($rootpath)) - $opt['rootpath'] = $rootpath; - else - { - $rootpath = './'; - $opt['rootpath'] = $rootpath; - } - // yepp, we will use UTF-8 mb_internal_encoding('UTF-8'); mb_regex_encoding('UTF-8'); @@ -47,10 +37,10 @@ define('regex_statpic_text', '^[a-zA-Z0-9\.\-_ @äüöÄÜÖß=)(\/\\\&*\$+~#!§%;,-?:\[\]{}¹²³\'\"`\|µ°]{0,29}$'); //load default webserver-settings and common includes - require_once($opt['rootpath'] . 'lib/settings.inc.php'); - require_once($opt['rootpath'] . 'lib/calculation.inc.php'); - require_once($opt['rootpath'] . 'lib/consts.inc.php'); - require_once($opt['rootpath'] . 'lib2/errorhandler.inc.php'); + require_once($GLOBALS['container']->get('ocde.config')->getBaseDir() . '/lib/settings.inc.php'); + require_once($GLOBALS['container']->get('ocde.config')->getBaseDir() . '/lib/calculation.inc.php'); + require_once($GLOBALS['container']->get('ocde.config')->getBaseDir() . '/lib/consts.inc.php'); + require_once($GLOBALS['container']->get('ocde.config')->getBaseDir() . '/lib2/errorhandler.inc.php'); // check for banned UAs $useragent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ""; @@ -396,14 +386,14 @@ if (isset($sql_debug) && ($sql_debug == true)) { - require_once($opt['rootpath'] . 'lib/sqldebugger.inc.php'); + require_once($GLOBALS['container']->get('ocde.config')->getBaseDir() . '/lib/sqldebugger.inc.php'); $result = sqldbg_execute($filtered_sql, $bSlave); if ($result === false) sql_error(); } else { // Zeitmessung für die Ausführung - require_once($opt['rootpath'] . 'lib/bench.inc.php'); + require_once($GLOBALS['container']->get('ocde.config')->getBaseDir() . '/lib/bench.inc.php'); $cSqlExecution = new Cbench; $cSqlExecution->start(); diff --git a/htdocs/lib2/html2text.class.php b/htdocs/lib2/html2text.class.php deleted file mode 100644 index 912ffa98..00000000 --- a/htdocs/lib2/html2text.class.php +++ /dev/null @@ -1,492 +0,0 @@ - * - * All rights reserved. * - * * - * This script is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * The GNU General Public License can be found at * - * http://www.gnu.org/copyleft/gpl.html. * - * * - * This script is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * Author(s): Jon Abernathy * - * * - * Last modified: 08/08/07 * - * * - *************************************************************************/ - - -/** - * Takes HTML and converts it to formatted, plain text. - * - * Thanks to Alexander Krug (http://www.krugar.de/) to pointing out and - * correcting an error in the regexp search array. Fixed 7/30/03. - * - * Updated set_html() function's file reading mechanism, 9/25/03. - * - * Thanks to Joss Sanglier (http://www.dancingbear.co.uk/) for adding - * several more HTML entity codes to the $search and $replace arrays. - * Updated 11/7/03. - * - * Thanks to Darius Kasperavicius (http://www.dar.dar.lt/) for - * suggesting the addition of $allowed_tags and its supporting function - * (which I slightly modified). Updated 3/12/04. - * - * Thanks to Justin Dearing for pointing out that a replacement for the - * tag was missing, and suggesting an appropriate fix. - * Updated 8/25/04. - * - * Thanks to Mathieu Collas (http://www.myefarm.com/) for finding a - * display/formatting bug in the _build_link_list() function: email - * readers would show the left bracket and number ("[1") as part of the - * rendered email address. - * Updated 12/16/04. - * - * Thanks to Wojciech Bajon (http://histeria.pl/) for submitting code - * to handle relative links, which I hadn't considered. I modified his - * code a bit to handle normal HTTP links and MAILTO links. Also for - * suggesting three additional HTML entity codes to search for. - * Updated 03/02/05. - * - * Thanks to Jacob Chandler for pointing out another link condition - * for the _build_link_list() function: "https". - * Updated 04/06/05. - * - * Thanks to Marc Bertrand (http://www.dresdensky.com/) for - * suggesting a revision to the word wrapping functionality; if you - * specify a $width of 0 or less, word wrapping will be ignored. - * Updated 11/02/06. - * - * *** Big housecleaning updates below: - * - * Thanks to Colin Brown (http://www.sparkdriver.co.uk/) for - * suggesting the fix to handle and blank lines (whitespace). - * Christian Basedau (http://www.movetheweb.de/) also suggested the - * blank lines fix. - * - * Special thanks to Marcus Bointon (http://www.synchromedia.co.uk/), - * Christian Basedau, Norbert Laposa (http://ln5.co.uk/), - * Bas van de Weijer, and Marijn van Butselaar - * for pointing out my glaring error in the handling. Marcus also - * supplied a host of fixes. - * - * Thanks to Jeffrey Silverman (http://www.newtnotes.com/) for pointing - * out that extra spaces should be compressed--a problem addressed with - * Marcus Bointon's fixes but that I had not yet incorporated. - * - * Thanks to Daniel Schledermann (http://www.typoconsult.dk/) for - * suggesting a valuable fix with tag handling. - * - * Thanks to Wojciech Bajon (again!) for suggesting fixes and additions, - * including the tag handling that Daniel Schledermann pointed - * out but that I had not yet incorporated. I haven't (yet) - * incorporated all of Wojciech's changes, though I may at some - * future time. - * - * *** End of the housecleaning updates. Updated 08/08/07. - * - * @author Jon Abernathy - * @version 1.0.0 - * @since PHP 4.0.2 - */ -class html2text -{ - - /** - * Contains the HTML content to convert. - * - * @var string $html - * @access public - */ - var $html; - - /** - * Contains the converted, formatted text. - * - * @var string $text - * @access public - */ - var $text; - - /** - * Maximum width of the formatted text, in columns. - * - * Set this value to 0 (or less) to ignore word wrapping - * and not constrain text to a fixed-width column. - * - * @var integer $width - * @access public - */ - var $width = 70; - - /** - * List of preg* regular expression patterns to search for, - * used in conjunction with $replace. - * - * @var array $search - * @access public - * @see $replace - */ - var $search = array( - "/\r/", // Non-legal carriage return - "/[\n\t]+/", // Newlines and tabs - '/[ ]{2,}/', // Runs of spaces, pre-handling - '/]*>.*?<\/script>/i', //