check if STDOUT is defined in plaintext.php to avoid notices (will now also prevent line wrapping when not on a shell, e.g. for browser output), refs #1308
merge 50ac7c9e6ef729647816f604612e7fdae0a3ade7...bd77877426e29d98924e8e85ce01f260994e7dfc (from 1.0)