Commit fee580f5 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Make print/SEO page also work with section names in guide URL-s.

parent a71c1cd5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ if (isset($_GET["_escaped_fragment_"]) || isset($_GET["print"])) {
    elseif (preg_match('/^\/api\/?$/', $fragment, $m)) {
      print_index_page();
    }
    elseif (preg_match('/^\/guide\/(.+)/', $fragment, $m)) {
    elseif (preg_match('/^\/guide\/(.+?)(-section-[0-9]+)?$/', $fragment, $m)) {
      $json = decode_file("guides/".$m[1]."/README.js");
      print_page($json["title"], '<div id="guide" style="padding: 1px">' . $json["guide"] . '</div>', $fragment);
    }
@@ -54,7 +54,7 @@ if (isset($_GET["_escaped_fragment_"]) || isset($_GET["print"])) {
    }
  }
  catch (Exception $e) {
    print_page($e->getMessage(), $e->getMessage());
    print_page($e->getMessage(), $e->getMessage(), $fragment);
  }
}
else {