[Fswiki-dev] Re: [RFC] キーに=を含む設定の取り扱い

Back to archive index

Naoki Takezoe takez****@aa*****
2005年 12月 15日 (木) 23:23:22 JST


竹添です。

ありがとうございます。それでよいと思います。

< 		$line = &trim($line);

ここが

>		$line =~ s/^\s+|\s+$//g;

こうなってるのはなんか理由があるでしょうか?

Makamaka wrote:
> まかまかです。
> 
> ページ名に=を含むページの参照権限が設定できない
> http://fswiki.poi.jp/wiki.cgi?page=BugTrack%2Dwiki%2F233
> 
> の対応ですが、
> キーに=が含まれている場合はsave_config_hash側で=の前に'\'をつけ、
> load_config_hash側では\が前にない=でsplitするというのでどうでしょうか。
> 
> # こんな感じ
> 
> 268,275c268,272
> < 		$line = &trim($line);
> < 		if(index($line,"#")==0 || $line eq "\n" || $line eq "\r" || $line eq "\r\n"){
> < 			next;
> < 		}
> < 		my $name  = substr($line,0,index($line,'='));
> < 		my $value = substr($line,index($line,'=')+1,length($line));
> < 		$name  = &trim($name);
> < 		$value = &trim($value);
> ---
> 
>>		$line =~ s/^\s+|\s+$//g;
>>		next if($line eq '' or $line =~ /^#/);
>>		my ($name,$value) = split(/\s*(?<![^\\]\\)=\s*/,$line,2);
>>		$name =~ s/\\=/=/g;
>>		$name =~ s/\\\\/\\/g;
> 
> 333c330,333
> < 		$text .= $key."=".$hash->{$key}."\n";
> ---
> 
>>		my $value = $hash->{$key};
>>		$key =~ s/\\$/\\\\/g;
>>		$key =~ s/=/\\=/g;
>>		$text .= $key."=" . $hash->{$key} . "\n";
> 
> 
> 
> 問題なさそうならコミットします。
> 
> --------
> まかまか
> maka2_fswik****@donzo*****
> _______________________________________________
> Fswiki-dev mailing list
> Fswik****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/fswiki-dev
> 
> 
> 

-- 
Naoki Takezoe <takez****@aa*****>




Fswiki-dev メーリングリストの案内
Back to archive index