http://www.mediawiki.org/wiki/Special:Code/MediaWiki/71984

Revision: 71984
Author:   yaron
Date:     2010-08-30 22:03:58 +0000 (Mon, 30 Aug 2010)

Log Message:
-----------
Fixed escaping in preg_match() call

Modified Paths:
--------------
    trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
    trunk/extensions/SemanticForms/libs/SF_ajax_form_preview.js

Modified: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
===================================================================
--- trunk/extensions/SemanticForms/includes/SF_FormPrinter.php  2010-08-30 
22:01:40 UTC (rev 71983)
+++ trunk/extensions/SemanticForms/includes/SF_FormPrinter.php  2010-08-30 
22:03:58 UTC (rev 71984)
@@ -379,7 +379,7 @@
             // even if there are more
            if ( $found_instance ) {
               $matches = array();
-              $search_pattern = '/{{' . $search_template_str . '\s*[\|}]/i';
+              $search_pattern = '/{{' . $preg_match_template_str . 
'\s*[\|}]/i';
               $content_str = str_replace( '_', ' ', $existing_page_content );
               preg_match($search_pattern, $content_str, $matches, 
PREG_OFFSET_CAPTURE);
              // is this check necessary?

Modified: trunk/extensions/SemanticForms/libs/SF_ajax_form_preview.js
===================================================================
--- trunk/extensions/SemanticForms/libs/SF_ajax_form_preview.js 2010-08-30 
22:01:40 UTC (rev 71983)
+++ trunk/extensions/SemanticForms/libs/SF_ajax_form_preview.js 2010-08-30 
22:03:58 UTC (rev 71984)
@@ -134,7 +134,12 @@
 
            if (aj2.readyState != 4) return;
 
-           htm = 
aj2.responseText.replace(/&gt;/g,'>').replace(/&lt;/g,'<').replace(/&quot;/g,'"').replace(/&amp;/g,'&').replace(/&apos;/g,"'");
+           htm = aj2.responseText.replace(/&gt;/g,'>')
+                       .replace(/&lt;/g,'<')
+                       .replace(/&quot;/g,'"')
+                       .replace(/&amp;/g,'&')
+                       .replace(/&apos;/g,"'")
+                       .replace("</body>", "<span 
id='SF_PREVIEW_EOD'/></body>");
 
            ifr = document.createElement('iframe');
            ifr.onload="alert('load')";
@@ -164,18 +169,18 @@
 
            doc.open();
            doc.write(htm);
-           doc.close();        
+           doc.close();
  
            interval=setInterval(function(){
 
+                   if ( ! doc.getElementById("SF_PREVIEW_EOD") ) return;
+
                    var visible = null;
 
                    visible = doc.getElementById("wikiPreview");
 
-                    if (!visible) return;
+                   clearInterval(interval);
 
-                    clearInterval(interval);
-
                    var currentfr=document.getElementById('ifrPreview');
 
                    if (currentfr && !window.opera){
@@ -214,9 +219,11 @@
 
                            visible = visible.parentNode;
                        }
-                       
-                       currentfr.style.height = " " + doc.body.scrollHeight + 
"px";
 
+                       doc.getElementById('content').style.background = "none 
white";
+
+                       currentfr.style.height = " " + vish + "px";
+
                        window.scrollTo(currentfr.offsetLeft, 
currentfr.offsetTop);
                        document.body.style.cursor = '';
 



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to