List Info

Thread: markupexpr.php error notices




markupexpr.php error notices
country flaguser name
United Kingdom
2007-12-09 11:49:27
I am getting these 'notices' when using in config.php:
error_reporting(E_ALL);

Notice: Undefined offset: 2 in
E:wwwsoftflowpmwikiscriptsmarkupexpr.php on line 81

Notice: Undefined index: # in
E:wwwsoftflowpmwikiscriptsmarkupexpr.php on line 94

Notice: Undefined offset: 1 in
E:wwwsoftflowpmwikiscriptsmarkupexpr.php(103) :
eval()'d code on line 1  


and when I include markupexprplus.php I get similar errors:


Notice: Undefined offset: 3 in
E:wwwsoftflowpmwikicookbookmarkupexprplus.php on line
106

Notice: Undefined index: # in
E:wwwsoftflowpmwikicookbookmarkupexprplus.php on line
119

Notice: Undefined offset: 1 in
E:wwwsoftflowpmwikicookbookmarkupexprplus.php(128) :
eval()'d code on line 1



 Hans


_______________________________________________
pmwiki-devel mailing list
pmwiki-develpmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Re: markupexpr.php error notices
user name
2007-12-09 15:11:40
On Dec 9, 2007 6:49 PM, Hans <design5softflow.co.uk> wrote:
> I am getting these 'notices' when using in config.php:
> error_reporting(E_ALL);
>
> Notice: Undefined offset: 2 in
E:wwwsoftflowpmwikiscriptsmarkupexpr.php on line 81
>
> Notice: Undefined index: # in
E:wwwsoftflowpmwikiscriptsmarkupexpr.php on line 94
>
> Notice: Undefined offset: 1 in
E:wwwsoftflowpmwikiscriptsmarkupexpr.php(103) :
eval()'d code on line 1
>
>
> and when I include markupexprplus.php I get similar
errors:
>
>
> Notice: Undefined offset: 3 in
E:wwwsoftflowpmwikicookbookmarkupexprplus.php on line
106
>
> Notice: Undefined index: # in
E:wwwsoftflowpmwikicookbookmarkupexprplus.php on line
119
>
> Notice: Undefined offset: 1 in
E:wwwsoftflowpmwikicookbookmarkupexprplus.php(128) :
eval()'d code on line 1
>
>
>
>  Hans
>
>
> _______________________________________________
> pmwiki-devel mailing list
> pmwiki-develpmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
>

The first two notices (of both script) could be safely
solved using
the 
operator.
The last one merely indicate that the resulting expression
isn't
compliant with the php syntax.

Could you please give the definition of the MarkupExpr
function which
is triggering this error?

Thanks for the report,
Dominique

_______________________________________________
pmwiki-devel mailing list
pmwiki-develpmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Re: markupexpr.php error notices
country flaguser name
United Kingdom
2007-12-09 16:40:24
Sunday, December 9, 2007, 9:11:40 PM, Dominique wrote:

> Could you please give the definition of the MarkupExpr
function which
> is triggering this error?

Oh i see it is mostly my own definition. But I am not quite
sure.
Here is the definition:

# {(catlist PAGENAME SEPARATOR)} (arguments optional)
$MarkupExpr['catlist'] = 'CategoryList($pagename, $args[0],
$args[1])';

function CategoryList($pn, $arg='', $sep=',') {
        global $CategoryGroup;
        if(!$arg=='') $pn = MakePageName($pn, $arg);
        if($sep==NULL) $sep = ",";
        $page = RetrieveAuthPage($pn, 'read', true);
        $pat = '/\[\[\!(.*?)\]\]/';
        $text = preg_replace('/\(:(.*?):\)/'
,"", $page['text']);
        if(preg_match_all($pat, $text, $matches)) {
        foreach($matches[1] as $i=>$m)
                 $catlist[] = MakePageName($pn,
$CategoryGroup.".".$m);
        return implode($sep, $catlist);
        }
}

I just added the  to args[0] , args[1], thanks for the
hint.
This cuts down the errors, but I still get some:

using {(catlist)} without arguments I get these errors:

Notice: Undefined offset: 3 in
...cookbookmarkupexprplus.php on line 106

Notice: Undefined index: # in
...cookbookmarkupexprplus.php on line 119

and when I use {(catlist )}  (extra space added) I get

Notice: Undefined index: # in ...cookbookmarkupexprplus.php
on line 119

and when I use {(catlist '')} I get no errors.

Please tell me if I can improve the definition, or if the
error comes
form the script. It seems that
    $x = $argp['#'];
in the script can be undefined.


Hans


_______________________________________________
pmwiki-devel mailing list
pmwiki-develpmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Re: markupexpr.php error notices
user name
2007-12-09 17:29:19
On Dec 9, 2007 11:40 PM, Hans <design5softflow.co.uk> wrote:
> Sunday, December 9, 2007, 9:11:40 PM, Dominique wrote:
>
> > Could you please give the definition of the
MarkupExpr function which
> > is triggering this error?
>
> Oh i see it is mostly my own definition. But I am not
quite sure.
> Here is the definition:
>
> # {(catlist PAGENAME SEPARATOR)} (arguments optional)
> $MarkupExpr['catlist'] = 'CategoryList($pagename, $args[0],
$args[1])';
>
> function CategoryList($pn, $arg='', $sep=',') {
>         global $CategoryGroup;
>         if(!$arg=='') $pn = MakePageName($pn, $arg);
>         if($sep==NULL) $sep = ",";
>         $page = RetrieveAuthPage($pn, 'read', true);
>         $pat = '/\[\[\!(.*?)\]\]/';
>         $text = preg_replace('/\(:(.*?):\)/'
,"", $page['text']);
>         if(preg_match_all($pat, $text, $matches)) {
>         foreach($matches[1] as $i=>$m)
>                  $catlist[] = MakePageName($pn,
$CategoryGroup.".".$m);
>         return implode($sep, $catlist);
>         }
> }
>
> I just added the  to args[0] , args[1], thanks for the
hint.
> This cuts down the errors, but I still get some:
>
> using {(catlist)} without arguments I get these
errors:
>
> Notice: Undefined offset: 3 in
...cookbookmarkupexprplus.php on line 106
>
> Notice: Undefined index: # in
...cookbookmarkupexprplus.php on line 119
>
> and when I use {(catlist )}  (extra space added) I get
>
> Notice: Undefined index: # in
...cookbookmarkupexprplus.php on line 119
>
> and when I use {(catlist '')} I get no errors.
>
> Please tell me if I can improve the definition, or if
the error comes
> form the script. It seems that
>     $x = $argp['#'];
> in the script can be undefined.
>
>
> Hans
>
>

That's funny, my initial remark was applying to the
MarkupExprPlus
script itself ;)

markupexprplus.php(106) should read:

  list($repl, $dummy, $func, $params) = $match;

and markupexprplus.php(119):

  $x = $argp['#']; $args = array();

(the same consideration applies to markupexpr.php)
The script has just been updated on pmwiki.org

-- 
Dominique

_______________________________________________
pmwiki-devel mailing list
pmwiki-develpmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )