[#3292] dir.c --- Dir.chdir error handling — Johan Holmberg <holmberg@...>

55 messages 2004/08/21
[#3350] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/06

Hi, Johan,

[#3351] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/06

Hello.

[#3352] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/06

Hi,

[#3353] Re: [PATCH] dir.c --- Dir.chdir error handling — nobu.nokada@... 2004/09/06

Hi,

[#3354] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/06

Hi,

[#3356] Re: [PATCH] dir.c --- Dir.chdir error handling — nobu.nokada@... 2004/09/07

Hi,

[#3369] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/09

Sorry for late posting. Typhoon striked me.....

[#3372] Re: [PATCH] dir.c --- Dir.chdir error handling — nobu.nokada@... 2004/09/10

Hi,

[#3374] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/10

[#3376] Re: [PATCH] dir.c --- Dir.chdir error handling — nobu.nokada@... 2004/09/10

Hi,

[#3378] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/11

nobu.nokada@softhome.net wrote:

[#3383] Re: [PATCH] dir.c --- Dir.chdir error handling — nobu.nokada@... 2004/09/12

Hi,

[#3384] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/13

[#3385] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/13

Hi,

[#3386] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/13

[#3387] Re: [PATCH] dir.c --- Dir.chdir error handling — ts <decoux@...> 2004/09/13

>>>>> "H" == H Yamamoto <ocean@m2.ccsnet.ne.jp> writes:

[#3392] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/14

[#3393] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/14

Hi,

[#3394] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/14

[#3395] Re: [PATCH] dir.c --- Dir.chdir error handling — ts <decoux@...> 2004/09/14

>>>>> "H" == H Yamamoto <ocean@m2.ccsnet.ne.jp> writes:

[#3399] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/15

[#3403] Re: [PATCH] dir.c --- Dir.chdir error handling — ts <decoux@...> 2004/09/15

>>>>> "H" == H Yamamoto <ocean@m2.ccsnet.ne.jp> writes:

[#3404] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/15

Hi,

[#3405] Re: [PATCH] dir.c --- Dir.chdir error handling — ts <decoux@...> 2004/09/15

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#3409] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/16

Hi,

[#3416] Re: [PATCH] dir.c --- Dir.chdir error handling — ts <decoux@...> 2004/09/16

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#3303] URGENT: what's the bug reporting system now? — Dave Thomas <dave@...>

Hello!

14 messages 2004/08/25

Re: 1.8.1 gsub/CGI behavior I can't explain

From: Austin Ziegler <halostatue@...>
Date: 2004-08-22 17:27:04 UTC
List: ruby-core #3294
On Mon, 23 Aug 2004 00:59:15 +0900, David A. Black <dblack@wobblini.net> wrote:
> I have no explanation for this, but here it is.
> 
> I have a gsub! call in a CGI script (part of RCRchive).  It has a
> block, and the purpose is to filter out unacceptable tags from
> user input:
> 

David, can you try this instead?

TAG = %r{<((?:\s*/?\s*)(\w+)(?:\s+[^>]+)?)>}

@text.gsub!(TAG) do
  caps = Regexp.last_match.captures
  if GOOD.include?(caps[1].downcase.strip)
    "<#{caps[0]}>"
  else
    "&lt;#{caps[0]}&gt;"
  end
end

If you prefer not to do Regexp.last_match, you can use:

@text.gsub!(TAG) do
  if GOOD.include?($2.downcase.strip)
    "<#{$1}>"
  else
    "&lt;#{$1}&gt;"
  end
end

This simplifies your regular expression at the cost of having to
replace the <> on good tags.

-austin
-- 
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

In This Thread