Index: trunk/extensions/uniwiki/GenericEditPage/GenericEditPage.php |
— | — | @@ -82,7 +82,9 @@ |
83 | 83 | |
84 | 84 | /* if no layout tag was found, this |
85 | 85 | * function does nothing useful */ |
86 | | - if ( !$matches[1][0] ) return array(); |
| 86 | + if ( !isset( $matches[1][0] ) ) { |
| 87 | + return array(); |
| 88 | + } |
87 | 89 | |
88 | 90 | /* get the wiki markup (containing the |
89 | 91 | * directives) from this page's layout */ |
— | — | @@ -437,6 +439,7 @@ |
438 | 440 | |
439 | 441 | /* special case: if the first (un-named) section has text in the layout, |
440 | 442 | * but not in the page, copy it. otherwise, use the page text (even if empty) */ |
| 443 | + // FIXME: Undefined offset: 0 in scenario without layout |
441 | 444 | $result[] = ( $layout[0]['text'] && !$page[0]['text'] ) ? $layout[0] : $page[0]; |
442 | 445 | |
443 | 446 | /* only show the un-named section if it is being used. as |
— | — | @@ -482,8 +485,10 @@ |
483 | 486 | } |
484 | 487 | } |
485 | 488 | |
486 | | - if ( $insert_at === null ) $result[] = $page[$i]; |
487 | | - else array_splice ( $result, $insert_at, 0, array( $page[$i] ) ); |
| 489 | + if ( $insert_at === null ) |
| 490 | + $result[] = $page[$i]; |
| 491 | + else |
| 492 | + array_splice ( $result, $insert_at, 0, array( $page[$i] ) ); |
488 | 493 | } |
489 | 494 | |
490 | 495 | /* check to see if there were any sections in use |
— | — | @@ -584,6 +589,7 @@ |
585 | 590 | |
586 | 591 | |
587 | 592 | // if this section has a title, show it |
| 593 | + // FIXME: Undefined index: title in scenario without layout |
588 | 594 | if ( $result[$i]['title'] ) { |
589 | 595 | $title = $result[$i]['title']; |
590 | 596 | if ( $result[$i]['lock-header'] ) { |
— | — | @@ -601,6 +607,7 @@ |
602 | 608 | /* always add a textarea, whether or |
603 | 609 | * not it is currently in use. titles |
604 | 610 | * without text are kind of useless */ |
| 611 | + // FIXME: Undefined index: lock-text in scenario without layout |
605 | 612 | if ( $result[$i]['lock-text'] ) { |
606 | 613 | |
607 | 614 | /* render the wiki markup into HTML, the old-school |
— | — | @@ -647,6 +654,7 @@ |
648 | 655 | |
649 | 656 | |
650 | 657 | // pass the layout name back, to be re-appended |
| 658 | + // FIXME: Undefined offset: 0 in scenario without layout |
651 | 659 | $out->addHTML ( "<input type='hidden' name='layout-name' value='{$layout[0]['name']}' />" ); |
652 | 660 | |
653 | 661 | |
— | — | @@ -695,12 +703,12 @@ |
696 | 704 | * pressing the "switch mode" button, then |
697 | 705 | * set a global to do some jiggery-pokery |
698 | 706 | * in the displayEditPage function, later */ |
699 | | - if ( $data['switch-mode'] ) |
| 707 | + if ( isset( $data['switch-mode'] ) ) |
700 | 708 | $wgSwitchMode = true; |
701 | 709 | |
702 | 710 | /* if we are editing in classic mode, |
703 | 711 | * then this function does nothing! */ |
704 | | - if ( $data['edit-mode'] != "generic" ) |
| 712 | + if ( isset( $data['edit-mode'] ) && $data['edit-mode'] != "generic" ) |
705 | 713 | return true; |
706 | 714 | |
707 | 715 | /* otherwise, clear the textbox and rebuild it |
— | — | @@ -759,7 +767,7 @@ |
760 | 768 | } |
761 | 769 | |
762 | 770 | // finally, re-add the layout name |
763 | | - if ( $data['layout-name'] ) { |
| 771 | + if ( isset( $data['layout-name'] ) ) { |
764 | 772 | $editpage_Obj->textbox1 .= "<layout name=\"{$data['layout-name']}\" />"; |
765 | 773 | } |
766 | 774 | |