RSS Feed broken

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
ormus7577
Regular
Posts: 122
Joined: Sat Nov 04, 2006 12:11 pm
Location: Ulm, Germany

RSS Feed broken

Post by ormus7577 »

Hi,

Some recently updated plugin must include a blank/line-feed. Because previously working feeds no longer validate, see:

http://tool.ormus.info/index.php?/feeds/index.rss2

I've checked a number of files already without success, any way to find this thing?
my installations:
family blog: http://familie.lobenstein.info/
personal blog: http://www.ormus.info/
OrmusTool Homepage: http://tool.ormus.info/
Online Adventskalender: http://www.ormus.info/pages/advent.html
strcat
Regular
Posts: 22
Joined: Fri Dec 09, 2005 7:09 pm
Contact:

Post by strcat »

Newline at the end of serendipity_config_local.inc.php?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Usually a language file or something like that. Go through each of the plugin PHP files of the plugins andlanguage files you updated, and search for whitespace before <?php or after ?>.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
ormus7577
Regular
Posts: 122
Joined: Sat Nov 04, 2006 12:11 pm
Location: Ulm, Germany

Post by ormus7577 »

As this seem to happen every now and then, can you think of any way to automatically check for those nasty blanks? (haven't found it yet, pita, as I can't recall what plugins I've updated...)
my installations:
family blog: http://familie.lobenstein.info/
personal blog: http://www.ormus.info/
OrmusTool Homepage: http://tool.ormus.info/
Online Adventskalender: http://www.ormus.info/pages/advent.html
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I've often thought about a way to check this, but actually I don't have a clue how to do that. It would be nice if the PHP engine could tell you that, where it happens.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
ormus7577
Regular
Posts: 122
Joined: Sat Nov 04, 2006 12:11 pm
Location: Ulm, Germany

Post by ormus7577 »

We're talking about the first <? and last ?> of a file only, right? Shouldn't it be possible to have some regular expression check for blanks before/after those tags? Shame I've slept through those regexp lessons :(
my installations:
family blog: http://familie.lobenstein.info/
personal blog: http://www.ormus.info/
OrmusTool Homepage: http://tool.ormus.info/
Online Adventskalender: http://www.ormus.info/pages/advent.html
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hab gerade mal ein kleines script entwickelt, das fand bei mir in der italiienischen glossary-sprachdateiund der englischen audioscrobbler datei wohl ein linebreak.

Kannst es ja mal probieren:

Code: Select all

<?php

function check($dir) {
  $dh = opendir($dir);
  while(false !== ($file = readdir($dh))) {
     if ($file == '.' || $file == '..') continue;
     if (is_dir($dir . '/' . $file)) {
         check($dir . '/' . $file);
     } elseif (preg_match('@\.php$@', $file)) {
         $p = file_get_contents($dir . '/' . $file);
         if (preg_match('@^(.+)<\?php@iU', $p, $m)) {
             echo $dir . '/' . $file . ' has padding space' . "\n";
         } elseif (preg_match('@\?>(.+)$@iU', $p, $m)) {
             if ($m[1] === "\n" || (ord($m[1][0]) === 13 && ord($m[1][1]) === 0
                 continue;
             }
             for($i=0; $i <= strlen($m[1]); $i++) {
                 $char = $m[1][$i];
                 echo $i . "/" . ord($char) . ": " . dechex(ord($char)) . "\n";
             }
             echo $dir . '/' . $file . ' has trailing space' . "\n";
             print_r($m);
         }
     }
  }
}

check('.');
Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply