Code Duplication    Length = 5-5 lines in 2 locations

lib/backend.php 1 location

@@ 109-113 (lines=5) @@
106
							if ($attr->name == "src") {
107
								$url = $attr->value;
108
								if (!$this->startsWith($url, "http") && !$this->startsWith($url, "/") && !$this->startsWith($url, "data")) {
109
									if ($data = Filesystem::file_get_contents($folder . "/" . $url)) {
110
										$type = pathinfo($url, PATHINFO_EXTENSION);
111
										$base64 = "data:image/" . $type . ";base64," . base64_encode($data);
112
										$html = str_replace($url, $base64, $html);
113
									}
114
								}
115
							}
116
						}

lib/Utility/Evernote.php 1 location

@@ 69-73 (lines=5) @@
66
							if ($attr->name == "src") {
67
								$url = $attr->value;
68
								if (!$utils->startsWith($url, "http") && !$utils->startsWith($url, "/") && !$utils->startsWith($url, "data")) {
69
									if ($data = Filesystem::file_get_contents($folder . "/" . $url)) {
70
										$type = pathinfo($url, PATHINFO_EXTENSION);
71
										$base64 = "data:image/" . $type . ";base64," . base64_encode($data);
72
										$html = str_replace($url, $base64, $html);
73
									}
74
								}
75
							}
76
						}