* Markus Krötzsch <[EMAIL PROTECTED]> [2007-12-12 21:07]:
> On Sonntag, 2. Dezember 2007, Thomas Bleher wrote:
> >  67         foreach($properties as $singleprop) {
> >  68                 $dv =
> > SMWFactbox::addProperty($singleprop,$value,$valueCaption); 69         }
> >
> > $dv is overwritten here on each iteration of the loop. This looks fishy.
> 
> Yes, but normally there is only one iteration anyway. What would you suggest 
> instead?

Hmm, should nested properties be allowed here?

FWIW, the regexp is
$semanticLinkPattern = '/\[\[               # Beginning of the link
                        (([^:][^]]*):[=:])+ # Property name (can be nested?)
                        (                   # After that:
                          (?:[^|\[\]]       #   either normal text (without |, 
[ or ])
                          |\[\[[^]]*\]\]    #   or a [[link]]
                          |\[[^]]*\]        #   or an [external link]
                        )*)                 # all this zero or more times
                        (\|([^]]*))?        # Display text (like "text" in 
[[link|text]]), optional
                        \]\]                # End of link
                        /x';

(I took the liberty of modifying it to make it more readable)



If nested properties should not be supported, all is fine, as $property
is just ([^:][^]]*), ie without the trailing :: or :=. Then the
preg_split and the for loop can be removed (OK, maybe the regexp could
be made more strict, but that's another issue).

If nested properties should be supported, this code is buggy, but I do
not know what the correct semantics would be anyway.

Regards,
Thomas

Attachment: signature.asc
Description: Digital signature

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to