the content string passed to the shortcode handler is broken. Can't quite figure out how, but the parameter is not a correctly formed string. For example, most of the string functions simply don't work. Using substr($content,0,4), for example, yields a substring that is not 4 characters long. strpos won't find anything. I went back to pre-3.1.3, and everything worked as expected using identical plugin code and identical content in the page.

It seems okay when the content doesn't span multiple lines.

I've attached a demo shortcode. See the output source to see wacky stuff.

My apologies. This is not a 3.1.3 bug, but rather a bug in the "PHP Shortcode" plugin. I thought I had disabled all my plugins, but missed that one. I was not using it, so apparently it affects the content, even if the shortcode is not being used.

I'm still pretty sure this did not show up until 3.1.3, but whatever, the problem is PHP Shortcode.