Page MenuHomePhabricator
Authored By
bzimport
Nov 21 2014, 9:00 PM
Size
1 KB
Referenced Files
None
Subscribers
None
Index: ProtectSection.php
===================================================================
RCS file: /cvsroot/wikipedia/extensions/ProtectSection/ProtectSection.php,v
retrieving revision 1.1
diff -u -r1.1 ProtectSection.php
--- ProtectSection.php 10 Jan 2006 20:00:19 -0000 1.1
+++ ProtectSection.php 5 Mar 2006 14:48:59 -0000
@@ -64,8 +64,8 @@
*/
function stripProtectTags ( &$parser , &$text, &$x ) {
- $text = str_replace( '<protect>', '', $text );
- $text = str_replace( '</protect>', '', $text );
+ $text = preg_replace("/<protect>/i","<span class='protected'>",$text);
+ $text = preg_replace("/<\/protect>/i","</span>",$text);
return true;
}
@@ -86,8 +86,8 @@
$text1 = $editpage->mArticle->getContent(true);
$text2 = $textbox1 ;
- preg_match_all( "/<protect>(.*?)<\/protect>/im", $text1, $list1, PREG_SET_ORDER );
- preg_match_all( "/<protect>(.*?)<\/protect>/im", $text2, $list2, PREG_SET_ORDER );
+ preg_match_all( "/<protect>(.*?)<\/protect>/msi", $text1, $list1, PREG_SET_ORDER );
+ preg_match_all( "/<protect>(.*?)<\/protect>/msi", $text2, $list2, PREG_SET_ORDER );
if( count($list1) != count($list2)) {
$msg = wfMsg( 'add_remove_protected_section');
$modifyProtect = true;

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2129
Default Alt Text
patch (1 KB)

Event Timeline