Permalink
Browse files

!bug: Windows CR/LF will break the parser

Due to strict regular expression the ZAML parser, and the $
does not match any linefeed, the author name is ignored,
and that is why any new setting will go to :default section.

We can fix this by change the regexp, or simplify :rtrim
the input $line. The 2nd way is much simpler, right?
  • Loading branch information...
1 parent c4797c9 commit 3c90e2fc8d3bf1e4de4bbd39b0aad1a52fcc963e @icy committed Aug 30, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 include/functions_icy_picture_modify.inc.php
@@ -395,6 +395,7 @@ function icy_zml_parser($data) {
}
foreach($data as $line) {
+ $line = rtrim($line);
# AUTHOR:
if (preg_match('/^([^[:space:]:]+):$/', $line, $gs)) {
$author = trim($gs[1]);

0 comments on commit 3c90e2f

Please sign in to comment.