This file is indexed.

/usr/bin/trean-url-checker is in php-horde-trean 1.1.1-2.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env php
<?php
/**
 *
 * Copyright 2005-2014 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file LICENSE for license information (BSD). If you did not
 * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
 *
 * @author Ben Chavet <ben@horde.org>
 * @author Chuck Hagenbuch <chuck@horde.org>
 */

if (file_exists(__DIR__ . '/../../trean/lib/Application.php')) {
    $baseDir = __DIR__ . '/../';
} else {
    require_once 'PEAR/Config.php';
    $baseDir = PEAR_Config::singleton()
        ->get('horde_dir', null, 'pear.horde.org') . '/trean/';
}
require_once $baseDir . 'lib/Application.php';
Horde_Registry::appInit('trean', array('cli' => true));

$factory = $injector->getInstance('Horde_Core_Factory_HttpClient');
$params = array('request.redirect' => false);

$ids = $trean_db->selectValues('SELECT bookmark_id FROM trean_bookmarks');
foreach ($ids as $bookmark_id) {
    $bookmark = $trean_gateway->getBookmark($bookmark_id);
    try {
        $response = $factory->create($params)->head($bookmark->url);
    } catch (Horde_Http_Exception $e) {
        $bookmark->http_status = 'error';
        continue;
    }
    $bookmark->http_status = $response->code;

    // If we've been redirected, update the bookmark's URL.
    if ($location = $response->getHeader('Location') &&
        $location != $bookmark->url) {
        $bookmark->url = $location;
    }

    $bookmark->save(false);
}