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

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