<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,7 +3,7 @@
 Plugin Name: ScreenSteps Live
 Plugin URI: http://screensteps.com/blog/2008/07/screensteps-live-wordpress-plugin/
 Description: This plugin will incorporate lessons from your ScreenSteps Live account into your WordPress Pages.
-Version: 1.0.7
+Version: 1.0.8
 Author: Blue Mango Learning Systems
 Author URI: http://www.screensteps.com
 */
@@ -342,10 +342,11 @@ function screenstepslive_listPages($the_output) {
 	if (empty($the_title) || $the_title == $post-&gt;post_title) {
 		return ($the_output);
 	} else {
-		// Now rename the page in the list to the original post title
-		$theNewOutput = preg_replace('/&gt;' . preg_quote($the_title, &quot;/&quot;) . '\&lt;/', '&gt;' . $post-&gt;post_title . '&lt;', $the_output, -1, $count);
-		if ($count &gt; 0) return $theNewOutput;
-		else return ($the_output);
+		// Now rename the page in the list to the original post title		
+		if ( preg_match( '/&gt;' . preg_quote($the_title, &quot;/&quot;) . '\&lt;/', $the_output, $matches, PREG_OFFSET_CAPTURE) ) {
+			$the_output = substr_replace( $the_output, '&gt;' . $post-&gt;post_title . '&lt;', $matches[0][1], strlen($matches[0][0]) );
+		}
+		return ($the_output);
 	}
 }
 
@@ -568,7 +569,14 @@ function screenstepslive_parseContent($the_content)
 		}
 	}
 	
-	if ($text != '') $the_content = preg_replace('/{{SCREENSTEPSLIVE_CONTENT}}/i', $text, $the_content);
+	if ($text != '') {
+		// case insensitive search/replace in PHP 5. preg_replace breaks if
+		// $1 or \\1 is in the string. This is the happy compromise.
+		if ( preg_match( '/{{SCREENSTEPSLIVE_CONTENT}}/i', $the_content, $matches, PREG_OFFSET_CAPTURE) ) {
+			$the_content = substr_replace( $the_content, $text, $matches[0][1], strlen($matches[0][0]) );
+		}
+		//$the_content = preg_replace('/{{SCREENSTEPSLIVE_CONTENT}}/i', $text, $the_content);
+	}
 	
     return $the_content;
 }</diff>
      <filename>screenstepslive.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ed0c3152942518cbf4f64080bb2e08bf44ec8ce8</id>
    </parent>
  </parents>
  <author>
    <name>Trevor K DeVore</name>
    <email>trevordevore@Trevors-iMac-2.home</email>
  </author>
  <url>http://github.com/bluemango/screensteps-live-wordpress-plugin/commit/1ce4732d9d0fb085cbbe62419a44e592397b0d7b</url>
  <id>1ce4732d9d0fb085cbbe62419a44e592397b0d7b</id>
  <committed-date>2009-10-08T09:32:33-07:00</committed-date>
  <authored-date>2009-10-08T09:32:33-07:00</authored-date>
  <message>got rid of preg_match. lesson content could contain backreference syntax even though we don't want backreferences.</message>
  <tree>5f7b2709f7b9f201ca6a333ef97d54f1e386410a</tree>
  <committer>
    <name>Trevor K DeVore</name>
    <email>trevordevore@Trevors-iMac-2.home</email>
  </committer>
</commit>
