Title: cherty's Replies | WordPress.org

---

# cherty

  [  ](https://wordpress.org/support/users/cherty/)

 *   [Profile](https://wordpress.org/support/users/cherty/)
 *   [Topics Started](https://wordpress.org/support/users/cherty/topics/)
 *   [Replies Created](https://wordpress.org/support/users/cherty/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/cherty/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/cherty/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/cherty/engagements/)
 *   [Favorites](https://wordpress.org/support/users/cherty/favorites/)

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Super Cache] [Plugin: WP Super Cache] wp super cache Warning: strpos() [function.strpos]: Offset not contained in](https://wordpress.org/support/topic/plugin-wp-super-cache-wp-super-cache-warning-strpos-functionstrpos-offset-not-contained-in-stri/)
 *  Thread Starter [cherty](https://wordpress.org/support/users/cherty/)
 * (@cherty)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-wp-super-cache-warning-strpos-functionstrpos-offset-not-contained-in-stri/#post-2832635)
 * I just tried the development version and it seemed to work well on my test website.
   The if statement on Line 28 seems to have solved my problem:
 *     ```
       if ( $blogcacheid != '' )
           $blogcacheid = substr( $blogcacheid, 0, strpos( $blogcacheid, '/', 1 ) );
       ```
   
 * The dev version is at [http://downloads.wordpress.org/plugin/wp-super-cache.zip](http://downloads.wordpress.org/plugin/wp-super-cache.zip)
   and was referenced on another forum item that you posted ([http://wordpress.org/support/topic/plugin-wp-super-cache-issue-with-scheduled-posts-not-showing-up](http://wordpress.org/support/topic/plugin-wp-super-cache-issue-with-scheduled-posts-not-showing-up)).
 * Debug on and php_error_log showed no errors. Test cache works fine and the two
   statements at the bottom of View Source pages display fine.
 * Thanks so much, Donncha.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Super Cache] [Plugin: WP Super Cache] wp super cache Warning: strpos() [function.strpos]: Offset not contained in](https://wordpress.org/support/topic/plugin-wp-super-cache-wp-super-cache-warning-strpos-functionstrpos-offset-not-contained-in-stri/)
 *  Thread Starter [cherty](https://wordpress.org/support/users/cherty/)
 * (@cherty)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-wp-super-cache-warning-strpos-functionstrpos-offset-not-contained-in-stri/#post-2832632)
 * Thanks. Here is what I added (lines 19 through 29):
 *     ```
       } else {
       		$request_uri = preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', str_replace( '..', '', $_SERVER['REQUEST_URI'] ) );
       		if( strpos( $request_uri, '/', 1 ) ) {
       			if( $base == '/' ) {
       				$blogcacheid = substr( $request_uri, 1, strpos( $request_uri, '/', 1 ) - 1 );
       			} else {
       			  //error_log( $_SERVER[ 'REQUEST_URI' ] . " $blogcacheid\n", 3, "err.txt" );  // test code added 6-20-12
       				error_log( "$request_uri $base $blogcacheid\n", 3, "err.txt" ); // test code added 6-21-12
       				$blogcacheid = str_replace( $base, '', $request_uri );
       				$blogcacheid = substr( $blogcacheid, 0, strpos( $blogcacheid, '/', 1 ) );
       			}
       ```
   
 * Here is how I navigated:
    Login, Homepage, Homepage Dashboard, Network Dashboard,
   Homepage, Blog Site, Blog Site Dashboard, Homepage
 * Here is the output to err.txt:
 *     ```
       /wp/wp-login.php /wp/ blog
       /wp/wp-login.php /wp/ blog
       /wp/wp-login.php /wp/ blog
       /wp/wp-login.php /wp/ blog
       /wp/ /wp/ blog
       /wp/ /wp/ blog
       /wp/bcc-news/ /wp/ blog
       /wp/bcc-news/ /wp/ blog
       /wp/ /wp/ blog
       /wp/bcc-news/ /wp/ blog
       /wp/ztest/ /wp/ blog
       /wp/ztest/ /wp/ blog
       /wp/ztest/page-1/ /wp/ blog
       /wp/ztest/page-1/ /wp/ blog
       /wp/ /wp/ blog
       /wp/bcc-news/ /wp/ blog
       ```
   
 * Note – The Test Cache works fine, and the two lines of cache code appear at the
   bottom of web pages using View Source.
 * Not sure if I am giving you what you want to see.
    Thanks for all your help.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Super Cache] [Plugin: WP Super Cache] wp super cache Warning: strpos() [function.strpos]: Offset not contained in](https://wordpress.org/support/topic/plugin-wp-super-cache-wp-super-cache-warning-strpos-functionstrpos-offset-not-contained-in-stri/)
 *  Thread Starter [cherty](https://wordpress.org/support/users/cherty/)
 * (@cherty)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-wp-super-cache-warning-strpos-functionstrpos-offset-not-contained-in-stri/#post-2832601)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Super Cache] [Plugin: WP Super Cache] wp super cache Warning: strpos() [function.strpos]: Offset not contained in](https://wordpress.org/support/topic/plugin-wp-super-cache-wp-super-cache-warning-strpos-functionstrpos-offset-not-contained-in-stri/)
 *  Thread Starter [cherty](https://wordpress.org/support/users/cherty/)
 * (@cherty)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-wp-super-cache-warning-strpos-functionstrpos-offset-not-contained-in-stri/#post-2832600)
 * Thank you for your quick reply. Sorry it’s taken so long to get back.
 * I reinstalled the WordPress site on my test xampp server, then network activated
   WP Super Cache. With debug on from the wp-config.php file, these two messages
   displayed in the browser:
 * `Warning: strpos() [function.strpos]: Offset not contained in string in C:\xampp\
   htdocs\wp\wp-content\plugins\wp-super-cache\wp-cache-base.php on line 26`
 * `Notice: Undefined variable: cache_wptouch in C:\xampp\htdocs\wp\wp-content\plugins\
   wp-super-cache\plugins\wptouch.php on line 109`
 * After setting caching on and using mod_rewrite, I added your error_log code to
   the plugins/wp-super-cache/wp-cache-base.php file (lines 19 through 28, sorry
   about indents below):
 *     ```
       } else {
       		$request_uri = preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', str_replace( '..', '', $_SERVER['REQUEST_URI'] ) );
       		if( strpos( $request_uri, '/', 1 ) ) {
       			if( $base == '/' ) {
       				$blogcacheid = substr( $request_uri, 1, strpos( $request_uri, '/', 1 ) - 1 );
       			} else {
       			  error_log( $_SERVER[ 'REQUEST_URI' ] . " $blogcacheid\n", 3, "err.txt" );  // test code added 6-20-12
       				$blogcacheid = str_replace( $base, '', $request_uri );
       				$blogcacheid = substr( $blogcacheid, 0, strpos( $blogcacheid, '/', 1 ) );
       			}
       ```
   
 * I visited these pages:
    1. Homepage 2. Homepage Dashboard 3. Network Dashboard
   4. Homepage 5. Blog Site 6. Blog site Dashboard 7. Homepage
 * Here is the err.txt output for the pages I visited:
 * /wp/ blog
    /wp/bcc-news/ blog /wp/ blog /wp/bcc-news/ blog /wp/ztest/ blog /wp/
   ztest/page-1/ blog /wp/ blog /wp/bcc-news/ blog
 * Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)