Code Duplication    Length = 70-70 lines in 2 locations

src/RSSFeed/simplepie/simplepie_1.3.1.mini.php 2 locations

@@ 1337-1406 (lines=70) @@
1334
        return $this->get_link(0);
1335
    }
1336
    
1337
    public function get_links($rel = 'alternate')
1338
    {
1339
        if (!isset($this->data['links']))
1340
        {
1341
            $this->data['links'] = array();
1342
            if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link'))
1343
            {
1344
                foreach ($links as $link)
1345
                {
1346
                    if (isset($link['attribs']['']['href']))
1347
                    {
1348
                        $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
1349
                        $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
1350
                    }
1351
                }
1352
            }
1353
            if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link'))
1354
            {
1355
                foreach ($links as $link)
1356
                {
1357
                    if (isset($link['attribs']['']['href']))
1358
                    {
1359
                        $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
1360
                        $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
1361
                    }
1362
                }
1363
            }
1364
            if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))
1365
            {
1366
                $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
1367
            }
1368
            if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link'))
1369
            {
1370
                $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
1371
            }
1372
            if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
1373
            {
1374
                $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
1375
            }
1376
            $keys = array_keys($this->data['links']);
1377
            foreach ($keys as $key)
1378
            {
1379
                if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
1380
                {
1381
                    if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
1382
                    {
1383
                        $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);
1384
                        $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];
1385
                    }
1386
                    else
1387
                    {
1388
                        $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
1389
                    }
1390
                }
1391
                elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
1392
                {
1393
                    $this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
1394
                }
1395
                $this->data['links'][$key] = array_unique($this->data['links'][$key]);
1396
            }
1397
        }
1398
        if (isset($this->data['links'][$rel]))
1399
        {
1400
            return $this->data['links'][$rel];
1401
        }
1402
        else
1403
        {
1404
            return null;
1405
        }
1406
    }
1407
    public function get_all_discovered_feeds()
1408
    {
1409
        return $this->all_discovered_feeds;
@@ 12937-13006 (lines=70) @@
12934
    {
12935
        return $this->get_link(0);
12936
    }
12937
    public function get_links($rel = 'alternate')
12938
    {
12939
        if (!isset($this->data['links']))
12940
        {
12941
            $this->data['links'] = array();
12942
            if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link'))
12943
            {
12944
                foreach ($links as $link)
12945
                {
12946
                    if (isset($link['attribs']['']['href']))
12947
                    {
12948
                        $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
12949
                        $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
12950
                    }
12951
                }
12952
            }
12953
            if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link'))
12954
            {
12955
                foreach ($links as $link)
12956
                {
12957
                    if (isset($link['attribs']['']['href']))
12958
                    {
12959
                        $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
12960
                        $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
12961
                    }
12962
                }
12963
            }
12964
            if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))
12965
            {
12966
                $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
12967
            }
12968
            if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link'))
12969
            {
12970
                $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
12971
            }
12972
            if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
12973
            {
12974
                $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
12975
            }
12976
            $keys = array_keys($this->data['links']);
12977
            foreach ($keys as $key)
12978
            {
12979
                if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
12980
                {
12981
                    if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
12982
                    {
12983
                        $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);
12984
                        $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];
12985
                    }
12986
                    else
12987
                    {
12988
                        $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
12989
                    }
12990
                }
12991
                elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
12992
                {
12993
                    $this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
12994
                }
12995
                $this->data['links'][$key] = array_unique($this->data['links'][$key]);
12996
            }
12997
        }
12998
        if (isset($this->data['links'][$rel]))
12999
        {
13000
            return $this->data['links'][$rel];
13001
        }
13002
        else
13003
        {
13004
            return null;
13005
        }
13006
    }
13007
    public function get_description()
13008
    {
13009
        if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))