Code Duplication    Length = 7-10 lines in 4 locations

lib/textmark/textmark.php 4 locations

@@ 122-131 (lines=10) @@
119
			# Soundcloud
120
			#
121
122
			if (preg_match('#soundcloud\.com/#', $url))
123
			{
124
				$id = urlencode($url);
125
126
				$html = <<<EOT
127
<iframe class="embed embed--soundcloud" $attributes src="https://w.soundcloud.com/player/?url=$url"></iframe>
128
EOT;
129
130
				return $this->hashPart($html, 'B');
131
			}
132
133
			#
134
			# Vimeo
@@ 137-144 (lines=8) @@
134
			# Vimeo
135
			#
136
137
			if (preg_match('#vimeo.com/(\d+)#', $url, $matches))
138
			{
139
				$html = <<<EOT
140
<iframe class="embed embed--vimeo" $attributes src="https://player.vimeo.com/video/{$matches[1]}?show_title=1&show_byline=1&show_portrait=0&color=F65FB8" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
141
EOT;
142
143
				return $this->hashPart($html, 'B');
144
			}
145
146
147
			#
@@ 151-157 (lines=7) @@
148
			# Dailymotion
149
			#
150
151
			if (preg_match('#dailymotion\.com/video/([^_]+)#', $url, $matches))
152
			{
153
				$html = <<<EOT
154
<iframe class="embed embed--dailymotion" $attributes src="//www.dailymotion.com/embed/video/{$matches[1]}"></iframe>
155
EOT;
156
				return $this->hashPart($html, 'B');
157
			}
158
159
			#
160
			# Instagram
@@ 163-169 (lines=7) @@
160
			# Instagram
161
			#
162
163
			if (preg_match('#instagram.com/p/([0-9A-Za-z\-]+)#', $url, $matches))
164
			{
165
				$html = <<<EOT
166
<iframe class="embed embed--instagram" $attributes src="//instagram.com/p/{$matches[1]}/embed/"></iframe>
167
EOT;
168
				return $this->hashPart($html, 'B');
169
			}
170
171
			#
172
			# fallback