Code Duplication    Length = 9-9 lines in 2 locations

Alpha/Util/Extension/TCPDFFacade.php 1 location

@@ 154-162 (lines=9) @@
151
        $attachments = array();
152
        preg_match_all('/href\=\"\$attachURL\/.*\"/', $this->content, $attachments);
153
154
        foreach ($attachments[0] as $attachmentURL) {
155
            $start = mb_strpos($attachmentURL, '/');
156
            $end = mb_strrpos($attachmentURL, '"');
157
            $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1));
158
159
            if (method_exists($this->BO, 'getAttachmentSecureURL')) {
160
                $this->content = str_replace($attachmentURL, 'href='.$this->BO->getAttachmentSecureURL($fileName), $this->content);
161
            }
162
        }
163
164
        // Handle image attachments
165
        $attachments = array();

Alpha/Util/Extension/MarkdownFacade.php 1 location

@@ 122-130 (lines=9) @@
119
        $attachments = array();
120
        preg_match_all('/href\=\"\$attachURL\/.*\"/', $this->content, $attachments);
121
122
        foreach ($attachments[0] as $attachmentURL) {
123
            $start = mb_strpos($attachmentURL, '/');
124
            $end = mb_strrpos($attachmentURL, '"');
125
            $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1));
126
127
            if (method_exists($this->BO, 'getAttachmentSecureURL')) {
128
                $this->content = str_replace($attachmentURL, 'href="'.$this->BO->getAttachmentSecureURL($fileName).'" rel="nofollow"', $this->content);
129
            }
130
        }
131
132
        // Handle image attachments
133
        $attachments = array();