View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0010956 | mantisbt | bugtracker | public | 2009-09-17 10:36 | 2009-10-07 14:19 |
| Reporter | cmfitch1 | Assigned To | dhx | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Target Version | 1.2.0rc2 | Fixed in Version | 1.2.0rc2 | ||
| Summary | 0010956: string_nl2br() wraps in the middle of words for preformatted text | ||||
| Description | The string_nl2br() function doesn't look for whitespace before wrapping a line when the text is in a block. I will attach a patch to correct this issue shortly. | ||||
| Tags | patch | ||||
| Attached Files | issue_10956.patch (832 bytes)
From 064a4a914f7d89ed0e5089f0d8d1d6ec9e39af8e Mon Sep 17 00:00:00 2001
From: Chris Fitch <cfitch@redcom.com>
Date: Thu, 17 Sep 2009 09:56:09 -0400
Subject: [PATCH] Fix line wrap regex for preformatted text
diff --git a/core/string_api.php b/core/string_api.php
index 3971dd2..f2b6614 100644
--- a/core/string_api.php
+++ b/core/string_api.php
@@ -106,7 +106,7 @@ function string_nl2br( $p_string, $p_wrap = 100 ) {
# if other encoded characters are a problem
$piece = preg_replace( '/ /', ' ', $piece );
if( ON == config_get( 'wrap_in_preformatted_text' ) ) {
- $output .= preg_replace( '/([^\n]{' . $p_wrap . '})(?!<\/pre>)/', "$1\n", $piece );
+ $output .= preg_replace( '/([^\n]{' . $p_wrap . ',}?[\s]+)(?!<\/pre>)/', "$1\n", $piece );
} else {
$output .= $piece;
}
--
1.6.0.4
| ||||
|
MantisBT: master-1.2.x 694037a6 2009-09-17 09:56 Chris Fitch Committer: dhx Details Diff |
Fix 0010956: Fix line wrap regex for preformatted text The string_nl2br() function doesn't look for whitespace before wrapping a line when the text is in a <pre> block. Signed-off-by: David Hicks <hickseydr@optusnet.com.au> |
Affected Issues 0010956 |
|
| mod - core/string_api.php | Diff File | ||
|
MantisBT: master 0fd12b74 2009-09-17 09:56 Chris Fitch Committer: dhx Details Diff |
Fix 0010956: Fix line wrap regex for preformatted text The string_nl2br() function doesn't look for whitespace before wrapping a line when the text is in a <pre> block. Signed-off-by: David Hicks <hickseydr@optusnet.com.au> |
Affected Issues 0010956 |
|
| mod - core/string_api.php | Diff File | ||