# HG changeset patch # User Tom Fredrik "BFG" Klaussen # Date 1457379883 -3600 # Node ID f2996720e6d6f1d9af6854577f9053da193e874c # Parent d5f3efba33e2e9e57f1485a3d855bbb2e480c1c4 Embed some flags, support for overriding. diff -r d5f3efba33e2 -r f2996720e6d6 Flag.inc --- a/Flag.inc Mon Mar 07 20:44:15 2016 +0100 +++ b/Flag.inc Mon Mar 07 20:44:43 2016 +0100 @@ -45,10 +45,14 @@ $this->lang = $lang; - $this->name = "../img/flag-${lang}"; - if ($this->active) - $this->name .= "-active"; - $this->name .= ".png"; + foreach ( [ 'img', '../img' ] as $dir) { + $this->name = "${dir}/flag-${lang}"; + if ($this->active) + $this->name .= "-active"; + $this->name .= ".png"; + if (file_exists($this->name)) + break; + } $cache = new CacheTimeCheck($this->name); $cache->setMaxAge(86400);