Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
enc_tab indents empty lines
[wfpl.git]
/
encode.php
diff --git
a/encode.php
b/encode.php
index
7afae37
..
4ef72ae
100644
(file)
--- a/
encode.php
+++ b/
encode.php
@@
-138,19
+138,12
@@
function enc_yesno($str) {
}
}
-# add a tab at the begining of each non-empty line
+# add a tab at the begining of each line
function enc_tab($str) {
function enc_tab($str) {
- $lines = explode("\n", $str);
- $out = '';
- foreach($lines as $line) {
- if($line) {
- $out .= "\t$line";
- }
- $out .= "\n";
+ if('' . $str === '') {
+ return '';
}
}
-
- # remove the extra newline added above
- return substr($out, 0, -1);
+ return "\t" . implode("\n\t", explode("\n", $str));
}
function enc_upper($str) {
}
function enc_upper($str) {