Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-10-23 03:45:25

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

[plugin] [ORPHAN] ajw_debug

ajw_debug

  • Surround blocks of code with <txp:ajw_debug allow="127.0.0.1,xx.xxx.xx.xx"> Hello world. </txp:ajw_debug>
  • Should allow for nesting plugin tags or PHP
  • Multiple IPs may be specified, separated by ‘,’

Download v0.1

The primary motivation for this was not being able to test locally and having plugins or php that I wanted to test out — but not publicly. Anyone know if using gethostbyaddr() would have any benefits over $_SERVER['REMOTE_ADDR']? I welcome any additional suggestions.

Last edited by Andrew (2007-01-03 03:55:47)

Offline

#2 2004-10-23 04:22:13

schussat
Plugin Author
Registered: 2004-02-24
Posts: 101
Website

Re: [plugin] [ORPHAN] ajw_debug

Hey compooter, this is a great idea!


-Alan

Offline

#3 2004-10-23 05:53:04

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] ajw_debug

If you use gethostbyaddr(), be sure to check that gethostbyname(gethostbyaddr($ip)) == $ip before trusting it. It’s possible (though not common) to set up a bogus reverse DNS entry.


Alex

Offline

#4 2004-10-23 08:15:47

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_debug

Currently it’s just checking REMOTE_ADDR; it seems pretty unlikely that a need otherwise would arise. Let me know of any funky behavior if you test it out.

Offline

#5 2004-11-02 01:58:35

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_debug

Does anyone — off the top of their head — have a quick explanation as to why this method doesn’t work for rss/atom? (enclosed content gets parsed no matter what)

Offline

#6 2004-11-02 02:15:18

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] ajw_debug

The RSS output function never calls parse(), so your tag handler isn’t executed.


Alex

Offline

#7 2004-11-02 02:21:25

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_debug

Thanks, zem. Any workaround?

Offline

#8 2004-11-02 08:33:02

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

Re: [plugin] [ORPHAN] ajw_debug

compooter, this post maybe can help you.


Johan Nilsson

Offline

#9 2004-11-02 16:13:07

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_debug

thanks for that. Perhaps that should move to feature request? I don’t see any security weaknesses in implementing it, and it would allow for my plugin to work all-around ;-)

Offline

Board footer

Powered by FluxBB