Export ceniku do JSONu
[mirrors/SokoMan.git] / apis / go.inc.php
diff --git a/apis/go.inc.php b/apis/go.inc.php
new file mode 100644 (file)
index 0000000..8b09bb6
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+if(!isset($_GET['q'])) $this->post_redirect_get('',"This assistant shouldn't be used like this");
+$id=$_GET['q'];
+$barcode_prefix_regexp = '/^'.preg_replace('/\//', '\/', BARCODE_PREFIX).'/';
+if(preg_match($barcode_prefix_regexp, $id)) $id=preg_replace($barcode_prefix_regexp, '', $id);
+if(preg_match('/\//', $id)) $this->post_redirect_get(strtolower($id));
+       else $this->post_redirect_get('?q='.urlencode($id));
This page took 0.117234 seconds and 4 git commands to generate.