[ewiki] Re: _DB_F_PART, Interwiki links
- From: Andy Fundinger <andy@xxxxxxxxxxx>
- To: "'ewiki@xxxxxxxxxxxxx'" <ewiki@xxxxxxxxxxxxx>
- Date: Mon, 5 Jan 2004 10:47:43 -0500
Ok, I revisited this and there was a bug when you run case sensitive.
Interwiki link hrefs were being converted to lowercase in all cases.
Changing ewiki_link_regex_callback() to use its properly cased $href_i is
the "correct" fix, but I prefer that we make interwiki links always case
insensitive. Code for both fixes are below:
Interwiki links obey EWIKI_CASE_INSENSITIVE:
#-- interwiki links
if (strpos($href, ":") and !strpos($href, "//")
and ($uu = strtok($href_i, ":")) and ($p1 =
ewiki_array($ewiki_config["interwiki"], $uu))) {
$type = array("interwiki", $uu);
while ($p1_alias = $ewiki_config["interwiki"][$p1]) {
$type[] = $p1;
$p1 = $p1_alias;
}
if (!strpos("%s", $p1)) {
$p1 .= "%s";
}
$href = str_replace("%s", strtok("\000"), $p1);
}
Interwiki links always case insensitive:
#-- interwiki links
if (strpos($href, ":") and !strpos($href, "//")
and ($uu = strtolower(strtok($href, ":"))) and ($p1 =
ewiki_array($ewiki_config["interwiki"], $uu,1,true))) {
$type = array("interwiki", $uu);
while ($p1_alias = $ewiki_config["interwiki"][$p1]) {
$type[] = $p1;
$p1 = $p1_alias;
}
if (!strpos("%s", $p1)) {
$p1 .= "%s";
}
$href = str_replace("%s", strtok("\000"), $p1);
}
I'll be committing a bunch of ewiki_auth calls this morning I hope.
-Andy
> -----Original Message-----
> From: Mario Salzer [mailto:mario@xxxxxxxxxxxxx]
> Sent: Monday, December 29, 2003 7:55 PM
> To: andy@xxxxxxxxxxx
> Subject: Re: [ewiki] Re: _DB_F_PART, Interwiki links
>
> Yep, I had no problems using [google:...] or [GOOGLE:...], so it seems at
> least working with the latest CVS version. And the other bug I've seen,
> only garbaged the resulting URL as far as I remember.
>
> mario
>
>
> > Are you sure? I'm in mid-merge presently but I think I had to lowercase
> to
> > make an interwiki link from my config file work.
> >
> > > Yep, the InterWikiAbbreviations are now case-insensitive also. But
> there
> > > is
> > > no need to lowercase the entries in $ewiki_config["interwiki"][...]
> > > because
> > > the lowercasing is automatically handled in the _link_regex_callback()
> > > function.
>
>
> _________________________________________________
> Scanned on 30 Dec 2003 01:55:58
> Scanning by http://erado.com
- Follow-Ups:
- [ewiki] Re: _DB_F_PART, Interwiki links
- From: Mario Salzer
Other related posts:
- » [ewiki] Re: _DB_F_PART, Interwiki links
- » [ewiki] Re: _DB_F_PART, Interwiki links
- » [ewiki] Re: _DB_F_PART, Interwiki links
- » [ewiki] Re: _DB_F_PART, Interwiki links
- [ewiki] Re: _DB_F_PART, Interwiki links
- From: Mario Salzer