Code Duplication    Length = 23-23 lines in 2 locations

main/inc/lib/icalcreator/iCalcreator.class.php 2 locations

@@ 1344-1366 (lines=23) @@
1341
            $lastix    = -1;
1342
            $propnames = array( 'calscale','method','prodid','version','x-' );
1343
            $proprows  = array();
1344
            foreach( $this->unparsed as $line ) {
1345
                $newProp = FALSE;
1346
                foreach ( $propnames as $propname ) {
1347
                    if( $propname == strtolower( substr( $line, 0, strlen( $propname )))) {
1348
                        $newProp = TRUE;
1349
                        break;
1350
                    }
1351
                }
1352
                if( $newProp ) {
1353
                    $newProp = FALSE;
1354
                    $lastix++;
1355
                    $proprows[$lastix]  = $line;
1356
                }
1357
                else {
1358
                    /* remove line breaks */
1359
                    if(( '\n' == substr( $proprows[$lastix], -2 )) &&
1360
                        (  ' ' == substr( $line, 0, 1 ))) {
1361
                        $proprows[$lastix] = substr( $proprows[$lastix], 0, strlen( $proprows[$lastix] ) - 2 );
1362
                        $line = substr( $line, 1 );
1363
                    }
1364
                    $proprows[$lastix] .= $line;
1365
                }
1366
            }
1367
            $toolbox = new calendarComponent();
1368
            foreach( $proprows as $line ) {
1369
                if( '\n' == substr( $line, -2 ))
@@ 6350-6372 (lines=23) @@
6347
        , 'summary', 'transp', 'trigger', 'tzid', 'tzname', 'tzoffsetfrom'
6348
        , 'tzoffsetto', 'tzurl', 'uid', 'url', 'x-' );
6349
        $proprows  = array();
6350
        foreach( $this->unparsed as $line ) {
6351
            $newProp = FALSE;
6352
            foreach ( $propnames as $propname ) {
6353
                if( $propname == strtolower( substr( $line, 0, strlen( $propname )))) {
6354
                    $newProp = TRUE;
6355
                    break;
6356
                }
6357
            }
6358
            if( $newProp ) {
6359
                $newProp = FALSE;
6360
                $lastix++;
6361
                $proprows[$lastix]  = $line;
6362
            }
6363
            else {
6364
                /* remove line breaks */
6365
                if(( '\n' == substr( $proprows[$lastix], -2 )) &&
6366
                    (  ' ' == substr( $line, 0, 1 ))) {
6367
                    $proprows[$lastix] = substr( $proprows[$lastix], 0, strlen( $proprows[$lastix] ) - 2 );
6368
                    $line = substr( $line, 1 );
6369
                }
6370
                $proprows[$lastix] .= $line;
6371
            }
6372
        }
6373
        /* parse each property 'line' */
6374
        foreach( $proprows as $line ) {
6375
            $line = str_replace( "\n ", '', $line );