Re: Why Sanitize::stripTags not working in controller index() function;

2010-12-14 Thread euromark
why would you want to do that in the first place
despite the fact that every line of code in your snippet seems to be
wrong^^

what you need is h() - in the view templates:
?php echo h($var); ?

thats all you need to escape and secure your views.


On 14 Dez., 07:08, Dave Maharaj m...@davemaharaj.com wrote:
 Off the top of my head I do not think stripTags works over each element of
 an array like $this-data

 You would need to be specific to the key like
 $this-data['GoogleNews']['content'] or whatever field. Check out
 Sanitize::clean , that works thru the array of $this-data with  8 different
 options to apply to the data set.

 Dave







 -Original Message-
 From: Lord_JABA [mailto:lordj...@gmail.com]
 Sent: December-13-10 5:48 PM
 To: CakePHP
 Subject: Why Sanitize::stripTags not working in controller index() function;

 I want to get rid of div tags in data from rss just before i send it
 to view.
 I'm trying do this that way:
 function index(){
                 $this-data=Sanitize::stripTags($this-data, 'div');
                 $this-set('gnews',  $this-paginate('GoogleNews') );
         }
 and that way:
 function index(){
                 Sanitize::stripTags($this-data, 'div');
                 $this-set('gnews',  $this-paginate('GoogleNews') );
         }
 but I'm still getting:
 (...)HTC EVO 4G/a/divdiv/divdiv(...)
 from?php debug($gnews)?

 What mistake I'm making??

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Why Sanitize::stripTags not working in controller index() function;

2010-12-14 Thread Ryan Schmidt
On Dec 14, 2010, at 09:09, euromark wrote:

 what you need is h() - in the view templates:
 ?php echo h($var); ?
 
 thats all you need to escape and secure your views.

Yeah but that doesn't accomplish his stated goal: to remove the div tags that 
are in the RSS data he's receiving:

 From: Lord_JABA [mailto:lordj...@gmail.com]
 Sent: December-13-10 5:48 PM
 To: CakePHP
 Subject: Why Sanitize::stripTags not working in controller index() function;
 
 I want to get rid of div tags in data from rss just before i send it
 to view.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Why Sanitize::stripTags not working in controller index() function;

2010-12-14 Thread euromark
sure^^ but based on the skill of this developer i guessed that he
wanted to secure the result
and thats not done by stripping tags

either way his code is so bad/unclear that we cannot be sure of what
he wants to achieve


On 14 Dez., 22:57, Ryan Schmidt google-2...@ryandesign.com wrote:
 On Dec 14, 2010, at 09:09, euromark wrote:

  what you need is h() - in the view templates:
  ?php echo h($var); ?

  thats all you need to escape and secure your views.

 Yeah but that doesn't accomplish his stated goal: to remove the div tags that 
 are in the RSS data he's receiving:







  From: Lord_JABA [mailto:lordj...@gmail.com]
  Sent: December-13-10 5:48 PM
  To: CakePHP
  Subject: Why Sanitize::stripTags not working in controller index() function;

  I want to get rid of div tags in data from rss just before i send it
  to view.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Why Sanitize::stripTags not working in controller index() function;

2010-12-13 Thread Lord_JABA
I want to get rid of div tags in data from rss just before i send it
to view.
I'm trying do this that way:
function index(){
$this-data=Sanitize::stripTags($this-data, 'div');
$this-set('gnews',  $this-paginate('GoogleNews') );
}
and that way:
function index(){
Sanitize::stripTags($this-data, 'div');
$this-set('gnews',  $this-paginate('GoogleNews') );
}
but I'm still getting:
(...)HTC EVO 4G/a/divdiv/divdiv(...)
from?php debug($gnews)?

What mistake I'm making??

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Why Sanitize::stripTags not working in controller index() function;

2010-12-13 Thread Amit Badkas
Hi,

I didn't get what you are trying to achieve here. You want sanitized data in
$gnews which is paginated list but you are sanitizing $this-data.
However, Sanitize::stripTags() needs first parameter as a string and as per
your description, $this-data seems to be an array.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Tue, Dec 14, 2010 at 2:47 AM, Lord_JABA lordj...@gmail.com wrote:

 I want to get rid of div tags in data from rss just before i send it
 to view.
 I'm trying do this that way:
 function index(){
$this-data=Sanitize::stripTags($this-data, 'div');
$this-set('gnews',  $this-paginate('GoogleNews') );
}
 and that way:
 function index(){
Sanitize::stripTags($this-data, 'div');
$this-set('gnews',  $this-paginate('GoogleNews') );
}
 but I'm still getting:
 (...)HTC EVO 4G/a/divdiv/divdiv(...)
 from?php debug($gnews)?

 What mistake I'm making??

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en