Commit 445d7142 authored by Dries's avatar Dries
Browse files

- Patch #508738 by Eric_A, terrychild: drupal_html_to_text() negative padding error.

parent d30e1588
......@@ -575,7 +575,7 @@ function _drupal_html_to_text_pad($text, $pad, $prefix = '') {
if (($p = strrpos($text, "\n")) === FALSE) {
$p = -1;
}
$n = max(0, 79 - (strlen($text) - $p));
$n = max(0, 79 - (strlen($text) - $p) - strlen($prefix));
// Add prefix and padding, and restore linebreak.
return $text . $prefix . str_repeat($pad, $n - strlen($prefix)) . "\n";
return $text . $prefix . str_repeat($pad, $n) . "\n";
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment