• I am seeing this error message repeatedly on two WordPress MS sites running BuddyPress and WP Super Cache:

    Warning: strpos(): Offset not contained in string in /websites/public_html/virtual-doc/storage/plugins/wp-super-cache/wp-cache-base.php on line 26
    
    Warning: Cannot modify header information - headers already sent by (output started at /websites/public_html/virtual-doc/storage/plugins/wp-super-cache/wp-cache-base.php:26) in /websites/public_html/virtual-doc/wp-includes/pluggable.php on line 866

    Line 26, that’s causing all the trouble, looks like this:

    $blogcacheid = substr( $blogcacheid, 0, strpos( $blogcacheid, '/', 1 ) );

    Any thoughts?

    https://www.ads-software.com/extend/plugins/wp-super-cache/

Viewing 4 replies - 1 through 4 (of 4 total)
  • First, you shouldn’t display php warnings and errors, use an error log to avoid leaking information about your server.

    I think that warning means that $blogcacheid is only 1 character or maybe just blank which is odd as it should be at least “/”. Best thing to do is debug that code using error_log to see exactly what is happening as I haven’t seen that warning before.

    Thread Starter John Peden

    (@jcpeden)

    Hi Donncha,

    The sites are still in development and the server is inaccessible to the World at the moment so I don’t want to turn of PHP errors just yet.

    Additionally, I’d read that turning them off just hides them so anyone who was interested would still be able to see the FPD (in this case). Your thoughts?

    The complete URL of the site is https://%linux_server_hostname%/virtual-doc/ so as you’re saying it does seem odd that $blogcacheid is reportedly too short. With that in mind, I think the real error lies a few lines earlier where $blogcacheid is defined.

    Ah, do you have a domain.tld in that hostname or is it a single word? That might be it. It’s an edge case that doesn’t happen “in the real world”.

    I don’t know what FPD stands for but you can send warnings and errors to log files. I find that more useful as I can “tail -f” the log in an ssh session.

    Thread Starter John Peden

    (@jcpeden)

    The hostname is a single (albeit hypenated) word.

    Weirdly I’m running an identical setup on the same server that doesn’t throw up the same error. The only difference is the installation folder:

    %hostname%/virtual-doc/ = error
    %hostname%/abroad/ = no error

    FPD is full path disclosure which I’m trying to avoid if possible as it gives a potential hacker an idea of your file structure and services your might be running. In this case, so long as the user is logged out I’ve setup the site to display a ‘members-only’ page which does the job.

    As you say, hopefully it won’t happen once we migrate to the live sub-domain.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP Super Cache error 'Offset not contained in string'’ is closed to new replies.