WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Yet Another Related Posts Plugin] Warning: strip_tags() error (21 posts)

  1. masterbassie
    Member
    Posted 4 years ago #

    I'm getting the following error seemingly from YARPP. Is there a known fix for this? Thanks

    Warning: strip_tags() expects parameter 1 to be string, array given in public_html/wp-includes/formatting.php on line 664

    http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/

  2. How are you getting this from YARPP? That error seems to be coming from a core file.

  3. lencanoot
    Member
    Posted 4 years ago #

    I have the same issue:

    Warning: strip_tags() expects parameter 1 to be string, array given in C:\xampp\htdocs\wordpress\wp-includes\formatting.php on line 631

    Possibly interfering with another plugin?

  4. lencanoot, are you using the builtin template or a custom template? Does the problem go away if you use one of the custom templates?

  5. lencanoot
    Member
    Posted 4 years ago #

    The problem also exists on other templates like Lightword. I add it to the index using the tag: <?php related_posts() ?>.

  6. lencanoot, I'm confused... is this an issue with that theme or with YARPP? Or an interaction?

  7. lencanoot
    Member
    Posted 4 years ago #

    Doesn't matter. All themes give the same error. So my own made theme does, but also the Lightword theme. Sorry I used the word template by mistake.

    It gives me the formatting error as stated above.

  8. MaviDeve
    Member
    Posted 4 years ago #

    Hey,
    I am getting the same error ...
    Warning: strip_tags() expects parameter 1 to be string, array given in C:\xAmpp\xampp\htdocs\homerism\wp-includes\formatting.php on line 631
    First I have deactivated and then activated all plugins ... As u may guess it was useless ... I dont have a solution but I have some clues and want to share them ;
    - I am using Unicode template files encoded with UTF-8 BOM (Some local non-latin chars are used ...)
    - I have read an article about the compatibility issues with two-columns plugin. (If there are two columns ... it comes custom wordpress queries or loops ...)
    - I am using custom wordpress queries(loop), custom wordpress template and also custom yarpp template ...
    This is it !
    I hope someone can find a solution as soon as possible ; I dont want to look for another plugin, it has great features ... (I hope it has ...)

  9. MaviDeve et al, where is this error being displayed? Could someone give me a link to a page which is doing this?

    What I want to know is, if you're calling YARPP using <?php related_posts() ?>, does it get displayed there or elsewhere?

  10. MaviDeve
    Member
    Posted 4 years ago #

    Error is showing up in the div where you place <?php related_posts() ?> in the template file category-??.php or single.php or home.php ... wherever u place <?php related_posts() ?>

  11. Could one of you guys try commenting out includes.php line 396 or remove the strip_tags from keywords.php line 50? I think it's possible that the first option would turn off the errors.

    -or- by chance, are you all *not* using any YARPP template, with the display excerpt option on? In which case, does turning on a YARPP template, even the default one, help?

    These three options cover all the ways in which YARPP ever calls strip_tags. I can't reproduce this at all, so I'm trying to narrow down the possibilities.

  12. MaviDeve
    Member
    Posted 4 years ago #

    Commenting out includes.php line 396 do not work out ... nor keywords.php line 50 ... Error is still there ...

    I've tried this out with a custom YARPP template and also with defaults, and without a template ... but I am still getting this error ... I've also activated and deactivated excerpt option ; but still no results ...

    Warning: strip_tags() expects parameter 1 to be string, array given in C:\xAmpp\xampp\htdocs\homerism\wp-includes\formatting.php  on line 631
    
    No related posts.

    I think I ll switch to WordPress Related Posts by denis for a while ... :( I know this is a great plugin but I ll be getting mad with that error ... BTW thx for ur help, I ll be waiting for an update :) If there is sth I can help u with to solve this issue, I ll be around ... :)

  13. @MaviDeve, the issue is frustrating indeed, but frustrating for me as well in that I can't reproduce it for the life of me.

    Those three points are the only places where strip_tags is used by YARPP. If you commented out all of those uses of it and you're still getting the error, perhaps it isn't a YARPP issue or it's an incompatibility with something else. :/ Are you sure you turned off any caching as well?

    Anyone else tried those?

  14. lencanoot
    Member
    Posted 4 years ago #

    Hey all,

    Yesterday I moved my entire wordpress site from my localhost to my online server and the issue was gone..

    Very strange. But other things changed as well: former IE/FF incompatibilities disappeared a I had to alter my IE stylesheet.

    For the ones with the same problem, try migrating it to another server.

    Still strange is that in some posts no related posts are shown while they do have used tags and are of the same category.

  15. lencanoot
    Member
    Posted 4 years ago #

    Btw, it's online, so for an example go here:

    http://www.getloud.nl/portfolio/?p=537#more-537

    Underneath the post (it's in Dutch) is the related post part. Left is the related posts, right is the posts from the same category.

  16. lincolnwebs
    Member
    Posted 4 years ago #

    I got the same error on MU 2.9.1 - it seemed to be coming from the_content(). Upgrading to 2.9.2 fixed it.

  17. Hmm... thank you all for the reports. @lencanoot did you change versions at this point as well? I'm glad it disappeared with the recent version of WPMU for @lincolnwebs.

  18. deeve007
    Member
    Posted 4 years ago #

    Same issue for me, and without a solution guess I'm heading to WordPress Related Posts too.

  19. @deeve007 sorry to hear that. I've still been testing and keeping an eye out, but I still haven't been able to reproduce this one. :'(

  20. jclark84
    Member
    Posted 4 years ago #

    I think this issue is related to PHP version 5.3. We recently changed servers and our new box has 5.3 installed.. To fix the error I just changed formatting.php line 631 to read
    $username = strip_tags($username[0]);
    Seems to work no issues.

  21. Hi all— just in case, I've added some code to 3.1.8 which should help ensure that the correct arguments are passed to strip_tags.

Topic Closed

This topic has been closed to new replies.

About this Topic