Changeset 2797 for trunk/wp-admin/admin-functions.php
- Timestamp:
- 08/20/2005 01:56:27 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/admin-functions.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r2792 r2797 798 798 } 799 799 800 // insert_with_markers: Owen Winkler 800 // insert_with_markers: Owen Winkler, fixed by Eric Anderson 801 801 // Inserts an array of strings into a file (.htaccess), placing it between 802 802 // BEGIN and END markers. Replaces existing marked info. Retains surrounding … … 815 815 if ($markerdata) { 816 816 $state = true; 817 $newline = '';818 817 foreach($markerdata as $markerline) { 819 if (strstr($markerline, "# BEGIN {$marker} ")) $state = false;820 if ($state) fwrite($f, "{$ newline}{$markerline}");821 if (strstr($markerline, "# END {$marker} ")) {822 fwrite($f, " {$newline}# BEGIN {$marker}");823 if(is_array($insertion)) foreach($insertion as $insertline) fwrite($f, "{$ newline}{$insertline}");824 fwrite($f, " {$newline}# END {$marker}");818 if (strstr($markerline, "# BEGIN {$marker}\n")) $state = false; 819 if ($state) fwrite($f, "{$markerline}\n"); 820 if (strstr($markerline, "# END {$marker}\n")) { 821 fwrite($f, "# BEGIN {$marker}\n"); 822 if(is_array($insertion)) foreach($insertion as $insertline) fwrite($f, "{$insertline}\n"); 823 fwrite($f, "# END {$marker}\n"); 825 824 $state = true; 826 825 $foundit = true; 827 826 } 828 $newline = "\n";829 827 } 830 828 } … … 832 830 fwrite($f, "# BEGIN {$marker}\n"); 833 831 foreach($insertion as $insertline) fwrite($f, "{$insertline}\n"); 834 fwrite($f, "# END {$marker} ");832 fwrite($f, "# END {$marker}\n"); 835 833 } 836 834 fclose($f); … … 841 839 } 842 840 843 // insert_with_markers: Owen Winkler841 // extract_from_markers: Owen Winkler 844 842 // Returns an array of strings from a file (.htaccess) from between BEGIN 845 843 // and END markers.
Note: See TracChangeset
for help on using the changeset viewer.