Skip to content
Permalink
Browse files

disabled line wrapping when switching to text editor mode; updates #236

  • Loading branch information...
following5 committed Sep 17, 2015
1 parent 73d0e93 commit 51f0c1b5f570ae281aa07c7fecbd5b87e3d04273
@@ -18,6 +18,8 @@
define('GUI_HTML', 0); // also defined in lib2/const.inc.php
define('GUI_TEXT', 1);
define('EMAIL_LINEWRAP', 72);
// for cachelists
define('cachelist_type_ignore', 1);
define('cachelist_type_watch', 2);
@@ -31,4 +31,6 @@
define('DB_MODE_BUSINESSLAYER', 1);
define('DB_MODE_USER', 2);
define('DB_DATE_FORMAT', '%Y-%m-%d %H:%M:%S');
define('EMAIL_LINEWRAP', 72);
?>
@@ -69,7 +69,7 @@ function processEditorInput($oldDescMode, $descMode, $text)
}
// ... and HTML to plain text
$text = html2plaintext($text, $oldDescMode = 0);
$text = html2plaintext($text, $oldDescMode = 0, 0);
$text = str_replace(array('[s![',']!s]'), '', $text);
}
@@ -81,8 +81,10 @@ function processEditorInput($oldDescMode, $descMode, $text)
// $texthtml0 is set if the text is from cache_desc.desc or cache_logs.text
// and text_html is 0, i.e. the text was edited in the "text" editor mode.
//
// If $wrap is > 0, longer lines will be wrapped to new lines.
function html2plaintext($text, $texthtml0)
function html2plaintext($text, $texthtml0, $wrap)
{
global $opt, $absolute_server_URI;
@@ -95,6 +97,7 @@ function html2plaintext($text, $texthtml0)
else
{
$h2t = new html2text($text);
$h2t->width = $wrap;
$h2t->set_base_url(isset($opt['page']['absolute_url']) ? $opt['page']['absolute_url'] : $absolute_server_URI);
$text = $h2t->get_text();
@@ -137,7 +137,7 @@ class html2text
* @var integer $width
* @access public
*/
var $width = 70;
var $width = 72;
/**
* List of preg* regular expression patterns to search for,
@@ -114,7 +114,7 @@
$message = $removed_message_title . "\n" . $message . "\n" . $removed_message_end;
}
$logtext = html2plaintext($log_record['log_text'], $log_record['text_html'] == 0);
$logtext = html2plaintext($log_record['log_text'], $log_record['text_html'] == 0, EMAIL_LINEWRAP);
//get cache owner name
$cache_owner_rs = sql("SELECT `username` FROM `user` WHERE `user_id`='&1'", $log_record['cache_owner_id']);
@@ -227,7 +227,7 @@ function process_owner_log($user_id, $log_id)
$rLog = sql_fetch_array($rsLog);
mysql_free_result($rsLog);
$logtext = html2plaintext($rLog['text'], $rLog['text_html'] == 0);
$logtext = html2plaintext($rLog['text'], $rLog['text_html'] == 0, EMAIL_LINEWRAP);
$language = sqlValue("SELECT `language` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null);
if (!$language)
@@ -263,7 +263,7 @@ function process_log_watch($user_id, $log_id)
$rLog = sql_fetch_array($rsLog);
mysql_free_result($rsLog);
$logtext = html2plaintext($rLog['text'], $rLog['text_html'] == 0);
$logtext = html2plaintext($rLog['text'], $rLog['text_html'] == 0, EMAIL_LINEWRAP);
$language = sqlValue("SELECT `language` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null);
if (!$language)

0 comments on commit 51f0c1b

Please sign in to comment.
You can’t perform that action at this time.