... A lot of the code in include exists in BOLTloadpage, and some of
the remaining could be moved there anyway to give a more versatile
loadpage (the side* markup, for example. Although that would do better
in pageshortcuts.) The header and footer code would be nice in
loadpage as well. As would the basepage argument... but maybe i'm
thinking about that the wrong way, if I want a versatile loadpage in a
plugin, I can call include.
I would recommend simplifying this code somewhat:
(check cache for doubles)
(call BOLTloadpage with the same arguments)
(do some post work if neccesary)
I mean, for one thing, the anchor is currently being searched for
twice. Also, if *page is a page-shortcut in include, let it be
generalized to pageshortcuts.
HA! I found the problem with my anchor call. I've sent the full
pagename to BOLTloadpage as I think it is unneccasry in include, so I
have this code in BOLTloadpage:
if ($anchor != '') {
$apos = strpos($out, "[[$anchor]]");
`echo anchor: strpos $apos >> include.log`;
if ($apos !== false) {
$out = substr($out, $apos + strlen
("[[$anchor]]"));
`echo "1 - $out" >> include.log`;
if (strpos($out, "[[#") !== false) $out =
substr($out, 0, strpos($out, "[[#"));
`echo "2 - $out" >> include.log`;
}
else return;
`echo "3 - $out" >> include.log`;
}
I am getting these results:
1 - name: Projektor
owner: ÄF
extra: test
status: test3
[[#log]]
* test
* test
* test
~data~
title: Projektor
~
author: pipping
~
changesummary: Page edited by pipping.
~
2 - name: Projektor
owner: ÄF
extra: test
status: test3
3 - name: Projektor
owner: ÄF
extra: test
status: test3
I Have no idea hat caused it. I changed the anchor code to this more
efficient (I think. Fewer strings are being allocated) and easier to
read (imho) code. The problem went away. Log still deleted the
contents of the anchored part of the page so I decided to do away with
the anchor all together, but this returned the correct string.
if ($anchor != '') {
$apos = strpos($out, "[[$anchor]]");
if( $apos === false ) return '';
$epos = strpos($out, "[[#", $apos + strlen
("[[$anchor]]"));
if( $epos === false ) $epos = strlen($out);
$out = substr($out, $apos, $epos);
}
On Sep 3, 2:13 pm, The Editor <[email protected]> wrote:
> Nope, The problem is the filtering BoltWire does to prevent wacky
> stuff from being entered blocked your page name. If you change the
> first few lines of BOLTFinclude to the following, it should fix it.
>
> if (isset($args['page'])) $page = $args['page'];
> else $page = $args[1];
> if (BOLTfilter(BOLTutf2url($page), 'page') == '') return;
>
> There may be other places this is an issue as well. Thanks for
> spotting this. These are generally easy to fix, just hard to find!
>
> Cheers,
> Dan
>
> P.S. It may be easier to set a special line in the filtering for when
> pages are being scanned to automatically convert to url encoded. But
> then of course, everything will pass and the filtering is useless...
> On the other hand, if all page names get url encoded, perhaps we don't
> need to worry about special chars anyway. I need to check into the
> security issues again. But I suspect that third line should just read
>
> if ($page == '') return;
>
> On Thu, Sep 3, 2009 at 7:33 AM, DrunkenMonk<[email protected]> wrote:
>
> > [(include snippets.snabblänkar)]
> > [(include snippets.login)]
>
> > Both pages exist. Only "login" is included. I added a log line to
> > BOLTFinclude, and found that it is only invoked once, for login. I
> > believe the problem is in BOLTMfunc, but I am still testing.
>
> > Actually, I can't be bothered with this right now. I'll rename all my
> > backbone pages to english until someone needs includes on a content
> > page.
>
> > But still, bug.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---