- if ( $section === false ) {
- $section = '';
- }
- if ( $local ) {
- $sectionTitle = new TitleValue( NS_MAIN, '', $section );
- } else {
- $sectionTitle = $title->createFragmentTarget( $section );
- }
- if ( $sectionTitle ) {
+ if ( $section !== '' && $section !== false ) {
+ if ( $local ) {
+ $sectionTitle = new TitleValue( NS_MAIN, '', $section );
+ } else {
+ $sectionTitle = $title->createFragmentTarget( $section );
+ }