Lines Matching refs:svg
19 $svg = file_get_contents($file, false, null, 0, 500);
20 return $this->isDiagram($svg);
28 * @param string $svg The raw SVG data (first 500 bytes are enough)
31 public function isDiagram($svg)
33 $svg = substr($svg, 0, 500); // makes checking a tiny bit faster
34 $svg = preg_replace('/<\?xml.*?>/', '', $svg);
35 $svg = preg_replace('/<!--.*?-->/', '', $svg);
36 $svg = preg_replace('/<!DOCTYPE.*?>/', '', $svg);
37 $svg = ltrim($svg);
39 if (empty($svg) || substr($svg, 0, 4) !== '<svg') return false;
42 return strpos($svg, 'embed.diagrams.net') || strpos($svg, 'draw.io') || strpos($svg, $serviceHost);