Gossamer Forum
Quote Reply
Bad_Link Problem
I am having a funny problem with Bad_Link Plugin.
  • Many times when I click on "Report Bad Link" it shows the regular page for reporting Bad Link.
  • However many times it shows me the sourcecode of the page.


Now I am little worried and was wondering if anyone has encountered such a problem and/or have found solution / alternative to this.

Need Scripts

Vishal
-------------------------------------------------------
Quote Reply
Re: [NeedScripts.Com] Bad_Link Problem In reply to
Hi,

This would be a problem on your server 99.9999% certain of that.

bad_link uses all standard Links SQL template calls, so somewhere the content header is probably being chewed up. If it was happening regularly, it would be a code problem, but if it's not repeatable, it's got to be a server issue -- the code is so simple (no advanced function/perl calls, linear logic, etc), it does the same thing every time, so the error would show up every time. I've never seen the problem at all, even during debugging.

If you mean "source code of the page" to be the HTML, the server/browser is losing the "HTML" content header, and displaying it as text -- but there should be no visible <%template%> type tags.

If you mean you are seeing <%etc%> type codes, un-replaced tags, etc, I'd like to know for certain if this is my code, and get a copy of the script you are actually running. There is no way raw template/file code should ever be passed out of any of my scripts -- ever. I'm paranoid... my coding reflects that <G>. That's why I don't use PHP -- the server can choke and spit out all sorts of sensitive stuff embedded in the raw html file. That can't happen if all output is run first through a cgi script. All my output -- ALL -- goes through SiteHTML::display, except for brief debugging codes and simple text.

If something is somehow bypassing, or slipping through, I'd like to know.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Bad_Link Problem In reply to
Hi pugdog,

I have this problem as well. The page display source code text instead of displaying it as a webpage. All <%code%> had been converted, for your info. Any ideas how to make it display it correctly as a webpage? Thanks.
Quote Reply
Re: [gundamz] Bad_Link Problem In reply to
If that's happening, the correct header isn't being sent.

Can you PM a copy of the template file and the bad_link.pm you are using? A link to the offending page would help too.

If the output is being displayed as text, the "html" header is being stripped somewhere, so the browser is not displaying it.

<%...%> tags are replaced, but you still see standard <...> tags ?


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Bad_Link Problem In reply to
PM on the way :)

P.S. If you need any other info, do let me know.

Need Scripts

Vishal
-------------------------------------------------------
Quote Reply
Re: [pugdog] Bad_Link Problem In reply to
I think I know what may be going on.

I use an

if DEBUG {} wrapper on my debug code, and output to the screen, not the log file, so I can follow what is happening.

IF you have DEBUG= something greater than 0 in your admin, you are seeing the debug code.

I just realized this is a bad idea, relying on the settings for debug, the way I use it, so I'll repackage the plugins with DEBUG=0 in the header once Andy and I set up shop on the new servers.

You can fix the problem now by editing the .pm file and if you see a DEBUG=1 set that to 0, or, after all the header stuff, before the first code block, put in

DEBUG=0;

A good place is after the "init" lines.

That should fix the problem, and explains why some people see it and some don't


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Bad_Link Problem In reply to
in my .pm file, default mode for DEBUG is 0.

it still show the html text.


For the "init" method, where should i put "DEBUG=0;"?
Quote Reply
Re: [gundamz] Bad_Link Problem In reply to
Hi,

I just downloaded the .tar, and that is not the file that I uploaded before. <groan>

There is no debug code in it, and the debugging messages are "bare". The "print" statements are what is doing it.

Edit the .cgi file,

You can remove:

print "The ID was found, the rec is ", %$rec, "<br><BR>";

line and that will fix it. That line prints the debug message, then dumps the <%rec%> hash.

That line should read:

DEBUG && print "The ID was found, the rec is ", %$rec, "<br><BR>";

But just _DELETE_ it. To use the DEBUG format, you'd need to add a DEBUG=0; to the file, to make sure it wasn't activated if you were trying to debug something else via the logs.

I looked at the later plugins, and I set DEBUG= at the top of the file just for that purpose.

For some reason, the .tar file on GT's site is not the right one.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Bad_Link Problem In reply to
thx pugdog. this fix the problem.
Quote Reply
Re: [pugdog] Bad_Link Problem In reply to
Thanks a lot bro.. now it is working like a charm :)

Need Scripts

Vishal
-------------------------------------------------------