Fixed... with very ugly, but working solution:

$return = preg_replace( '/media-(.*?)]/', '', $return);
$return = str_replace( 'swfobject.registerObject(">-->', '', $return);

Yep, I know, looks dreadful. :-)

P.S.
I hope it venial sin 'cause I'm not a programmer at all. :-)

On 15 июн, 19:22, Paul <[email protected]> wrote:
> Of course, I do not understand, that's why I'm here. :-)
>
> But I just want to strip this, from the PROMO part only:
>
> <script type="text/javascript">SOME_CODE</script>
>
> From the part that created by this line:
>
> Format::apply_with_hook_params( 'more', 'post_content_excerpt', '',
> 55, 1 );
>
> On 15 июн, 19:12, Colin <[email protected]> wrote:
>
> > Hi Paul
>
> > I don't think you understand the strip_tags() function.
>
> > > return strip_tags($return, '<script>');
>
> > ... says, strip ALL tags EXCEPT <script>.  Check the docs 
> > athttp://php.net/strip_tags.  So if you don't want other tags to be
> > stripped, you need to add them to the list of exceptions.
>
> > HTH
> > Colin
>
> > On Tue, Jun 15, 2010 at 4:54 PM, Paul <[email protected]> wrote:
> > > Looks like this expression a little buggy:
>
> > > return strip_tags($return, '<script>');
>
> > > It remove ALL promo text, not a only <script>,  IF some <script></
> > > script> stand at the top of the post.
>
> > > How to do something like this?
>
> > > $return = str_replace( "/((<[\s\/]*script\b[^>]*>)([^>]*)(<\/script>))/
> > > i", ' ', $return);
>
> > > I guess it will be easy to do a quick str_replace for <script> tags.
>
> > --
> > Colin Seymour
> > Blog:http://colinseymour.co.uk
> > Tech Stuff:http://lildude.co.uk
> > Barefoot Running:http://barefootrunner.co.uk
> > IRC: lildude #habari

-- 
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/habari-dev

Reply via email to