Tested, with minor tweak. Also removed now un-needed code
Patch by Harry Burt
* (bug 28034) uploading file to local wiki when file exists on shared repository
(commons) gives spurious info in the warning message
* Usernames get lost when selecting different sorts on Special:listfiles
+* (Bug 14005) editing section 0 of an existing but empty page gives no such
+ section error
=== API changes in 1.18 ===
* (bug 26339) Throw warning when truncating an overlarge API result
# Find the target section
if ( $sectionIndex == 0 ) {
- # Section zero doesn't nest, level=big
- $targetLevel = 1000;
+ if ( !$node ) {
+ # The page definitely exists - we checked that earlier - so it must be blank: see bug #14005
+ return $text;
+ }
} else {
while ( $node ) {
if ( $node->getName() === 'h' ) {