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

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