GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 70-72 lines in 2 locations

symphony/content/content.blueprintsevents.php 1 location

@@ 583-652 (lines=70) @@
580
            }
581
582
            // Write the file
583
            if (!is_writable(dirname($file)) || !General::writeFile($file, $eventShell, Symphony::Configuration()->get('write_mode', 'file'))) {
584
                $this->pageAlert(
585
                    __('Failed to write Event to disk.')
586
                    . ' ' . __('Please check permissions on %s.', array('<code>/workspace/events</code>')),
587
                    Alert::ERROR
588
                );
589
590
                // Write successful
591
            } else {
592
                if (function_exists('opcache_invalidate')) {
593
                    opcache_invalidate($file, true);
594
                }
595
596
                // Attach this event to pages
597
                $connections = $fields['connections'];
598
                ResourceManager::setPages(ResourceManager::RESOURCE_TYPE_EVENT, is_null($existing_handle) ? $classname : $existing_handle, $connections);
599
600
                if ($queueForDeletion) {
601
                    General::deleteFile($queueForDeletion);
602
603
                    $pages = PageManager::fetch(false, array('events', 'id'), array("
604
                        `events` REGEXP '[[:<:]]" . $existing_handle . "[[:>:]]'
605
                    "));
606
607
                    if (is_array($pages) && !empty($pages)) {
608
                        foreach ($pages as $page) {
609
                            $page['events'] = preg_replace('/\b'.$existing_handle.'\b/i', $classname, $page['events']);
610
611
                            PageManager::edit($page['id'], $page);
612
                        }
613
                    }
614
                }
615
616
                if ($this->_context['action'] === 'new') {
617
                    /**
618
                     * After creating the Event, the path to the Event file is provided
619
                     *
620
                     * @delegate EventPostCreate
621
                     * @since Symphony 2.2
622
                     * @param string $context
623
                     * '/blueprints/events/'
624
                     * @param string $file
625
                     *  The path to the Event file
626
                     */
627
                    Symphony::ExtensionManager()->notifyMembers('EventPostCreate', '/blueprints/events/', array(
628
                        'file' => $file
629
                    ));
630
                } else {
631
                    /**
632
                     * After editing the Event, the path to the Event file is provided
633
                     *
634
                     * @delegate EventPostEdit
635
                     * @since Symphony 2.2
636
                     * @param string $context
637
                     * '/blueprints/events/'
638
                     * @param string $file
639
                     *  The path to the Event file
640
                     * @param string $previous_file
641
                     *  The path of the previous Event file in the case where an Event may
642
                     *  have been renamed. To get the handle from this value, see
643
                     *  `EventManager::__getHandleFromFilename`
644
                     */
645
                    Symphony::ExtensionManager()->notifyMembers('EventPostEdit', '/blueprints/events/', array(
646
                        'file' => $file,
647
                        'previous_file' => ($queueForDeletion) ? $queueForDeletion : null
648
                    ));
649
                }
650
651
                redirect(SYMPHONY_URL . '/blueprints/events/edit/'. $classname . '/' . ($this->_context['action'] === 'new' ? 'created' : 'saved') . '/');
652
            }
653
        }
654
    }
655

symphony/content/content.blueprintsdatasources.php 1 location

@@ 1395-1466 (lines=72) @@
1392
            $dsShell = preg_replace(array('/<!--[\w ]++-->/', '/(\t+[\r\n]){2,}/', '/(\r\n){2,}/'), '$1', $dsShell);
1393
1394
            // Write the file
1395
            if (!is_writable(dirname($file)) || !General::writeFile($file, $dsShell, Symphony::Configuration()->get('write_mode', 'file'), 'w', true)) {
1396
                $this->pageAlert(
1397
                    __('Failed to write Data source to disk.')
1398
                    . ' ' . __('Please check permissions on %s.', array('<code>/workspace/data-sources</code>')),
1399
                    Alert::ERROR
1400
                );
1401
1402
                // Write successful
1403
            } else {
1404
                if (function_exists('opcache_invalidate')) {
1405
                    opcache_invalidate($file, true);
1406
                }
1407
1408
                // Attach this datasources to pages
1409
                $connections = $fields['connections'];
1410
                ResourceManager::setPages(ResourceManager::RESOURCE_TYPE_DS, is_null($existing_handle) ? $classname : $existing_handle, $connections);
1411
1412
                // If the datasource has been updated and the name changed, then adjust all the existing pages that have the old datasource name
1413
                if ($queueForDeletion) {
1414
                    General::deleteFile($queueForDeletion);
1415
1416
                    // Update pages that use this DS
1417
                    $pages = PageManager::fetch(false, array('data_sources', 'id'), array("
1418
                        `data_sources` REGEXP '[[:<:]]" . $existing_handle . "[[:>:]]'
1419
                    "));
1420
1421
                    if (is_array($pages) && !empty($pages)) {
1422
                        foreach ($pages as $page) {
1423
                            $page['data_sources'] = preg_replace('/\b'.$existing_handle.'\b/i', $classname, $page['data_sources']);
1424
1425
                            PageManager::edit($page['id'], $page);
1426
                        }
1427
                    }
1428
                }
1429
1430
                if ($this->_context['action'] === 'new') {
1431
                    /**
1432
                     * After creating the Datasource, the path to the Datasource file is provided
1433
                     *
1434
                     * @delegate DatasourcePostCreate
1435
                     * @since Symphony 2.2
1436
                     * @param string $context
1437
                     * '/blueprints/datasources/'
1438
                     * @param string $file
1439
                     *  The path to the Datasource file
1440
                     */
1441
                    Symphony::ExtensionManager()->notifyMembers('DatasourcePostCreate', '/blueprints/datasources/', array(
1442
                        'file' => $file
1443
                    ));
1444
                } else {
1445
                    /**
1446
                     * After editing the Datasource, the path to the Datasource file is provided
1447
                     *
1448
                     * @delegate DatasourcePostEdit
1449
                     * @since Symphony 2.2
1450
                     * @param string $context
1451
                     * '/blueprints/datasources/'
1452
                     * @param string $file
1453
                     *  The path to the Datasource file
1454
                     * @param string $previous_file
1455
                     *  The path of the previous Datasource file in the case where a Datasource may
1456
                     *  have been renamed. To get the handle from this value, see
1457
                     *  `DatasourceManager::__getHandleFromFilename`
1458
                     */
1459
                    Symphony::ExtensionManager()->notifyMembers('DatasourcePostEdit', '/blueprints/datasources/', array(
1460
                        'file' => $file,
1461
                        'previous_file' => ($queueForDeletion) ? $queueForDeletion : null
1462
                    ));
1463
                }
1464
1465
                redirect(SYMPHONY_URL . '/blueprints/datasources/edit/'.$classname.'/'.($this->_context['action'] === 'new' ? 'created' : 'saved') . '/');
1466
            }
1467
        }
1468
    }
1469