Code Duplication    Length = 1-1 lines in 4 locations

lib/Book.php 1 location

@@ 143-143 (lines=1) @@
140
141
    public function getDetailUrl () {
142
        $urlParam = $this->getUri();
143
        if (!is_null(GetUrlParam(DB))) $urlParam = addURLParameter($urlParam, DB, GetUrlParam (DB));
144
        return 'index.php' . $urlParam;
145
    }
146

lib/Data.php 1 location

@@ 194-194 (lines=1) @@
191
                $urlParam = self::handleThumbnailLink($urlParam, $height);
192
            }
193
            $urlParam = addURLParameter($urlParam, "id", $book->id);
194
            if (!is_null (GetUrlParam (DB))) $urlParam = addURLParameter ($urlParam, DB, GetUrlParam (DB));
195
            if ($config['cops_thumbnail_handling'] != "1" &&
196
                !empty ($config['cops_thumbnail_handling']) &&
197
                $rel == Link::OPDS_THUMBNAIL_TYPE) {

lib/OPDS_renderer.php 2 locations

@@ 61-61 (lines=1) @@
58
                $xml->startElement ("Url");
59
                    $xml->writeAttribute ("type", 'application/atom+xml');
60
                    $urlparam = "?query={searchTerms}";
61
                    if (!is_null (GetUrlParam (DB))) $urlparam = addURLParameter ($urlparam, DB, GetUrlParam (DB));
62
                    $urlparam = str_replace ("%7B", "{", $urlparam);
63
                    $urlparam = str_replace ("%7D", "}", $urlparam);
64
                    $xml->writeAttribute ("template", $config['cops_full_url'] . 'feed.php' . $urlparam);
@@ 127-127 (lines=1) @@
124
            $link = new LinkNavigation ("?" . getQueryString (), "self");
125
            self::renderLink ($link);
126
            $urlparam = "?";
127
            if (!is_null (GetUrlParam (DB))) $urlparam = addURLParameter ($urlparam, DB, GetUrlParam (DB));
128
            if ($config['cops_generate_invalid_opds_stream'] == 0 || preg_match("/(MantanoReader|FBReader)/", $_SERVER['HTTP_USER_AGENT'])) {
129
                // Good and compliant way of handling search
130
                $urlparam = addURLParameter ($urlparam, "page", Base::PAGE_OPENSEARCH);