MyBB Community Forums

Full Version: Post message - whitespace replaced with nbsp - wasting of bytes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Files: inc/class_parser.php, inc/functions.php

Continous whitespaces from posts message are replaced with    :
$message = str_replace("  ", "  ", $message);
One byte is is expanded to 6 bytes...
Better use CSS:
<div style="white-space: pre;"></div>
http://www.w3.org/TR/CSS1#white-space

Have a look:
http://www.kozik.net.pl/tmp/whitespace_e...s/css.html (400 bytes)
http://www.kozik.net.pl/tmp/whitespace_e.../nbsp.html (2 kB)


Anyway - these solutions can produce another issue like this:
begin                                                                                                                                                                                                                                                                                                          end
The issue is that a single white space character should wrap; white space is only considered significant if two such characters appear in a row.