Sorry about the lack of details, what I meant was that any variable that
is being sent to deferCreate will be overwritten by the last call to it,
causing the database pointer to be NULL, I do not know how to send a
copy that will not get overwritten, but I did find a way around it,
which is using the internal path, grant you this has security issues,
maybe I could use another method that is more secure, not sure what that
is, but as long as the text is cleaned in the bind function like below,
where lookupPath is internalPath(), it should be ok, as long as it has
no SQL statements
Wt::Dbo::ptr<MenuMan> thisMenu = session_.find<MenuMan>().where("path
= ?").bind(lookupPath).where("language = ?").bind(lang_);
or
Wt::WText(Wt::WString::tr(lookupPath)

I am doing a look up of the Path to find the content for the page in a
database, or an ID for template look up.

Bind does clean the statement of SQL doesn't it?

In this case its just a look up, so even if someone tries to hack it,
all they will get is what is in the data source or a blank page.

Thanks for the help.

On Mon, 2014-09-01 at 15:26 +0200, Koen Deforche wrote:
> Hey,
> 
> 
> 
> What do you mean with 'database pointer', what is it, where do you
> store it, and how do you access it ? I would not foresee any problems
> related to deferCreate().
> 
> 
> Regards,
> koen
> 
> 
> 
> 2014-08-22 0:35 GMT+02:00 Jeffrey Scott Flesher Gmail
> <jeffrey.scott.fles...@gmail.com>:
> 
>         I am using the deferCreate function from Wt-home example to
>         create Menu Items, I need to get information form a database,
>         the problem is that the database pointer is null, my guess is
>         that the examples I have seen, all use static content, is
>         there a catch to using a database in this function?
>         
>         Does anyone have a working example of deferCreate with a
>         database call?
>         
>         Thanks
>         Jeff Flesher
>         
>         
>         
> ------------------------------------------------------------------------------
>         Slashdot TV.
>         Video for Nerds.  Stuff that matters.
>         http://tv.slashdot.org/
>         _______________________________________________
>         witty-interest mailing list
>         witty-interest@lists.sourceforge.net
>         https://lists.sourceforge.net/lists/listinfo/witty-interest
>         
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Slashdot TV.  
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________ witty-interest mailing list 
> witty-interest@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/witty-interest
------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to