]> git.plutz.net Git - cgilite/blobdiff - page.sh
force http status code with redirect
[cgilite] / page.sh
diff --git a/page.sh b/page.sh
index cb1b87ffd85b5438c2e46a439c92f947e721e165..f68df8e26b92445703aee85cbd83fe63ff3a82de 100755 (executable)
--- a/page.sh
+++ b/page.sh
 # You should have received a copy of the GNU Affero General Public License
 # along with shcgi.  If not, see <http://www.gnu.org/licenses/>. 
 
-printf "Content-Type: text/html;charset=utf-8\n\n"
-
-PAGE=$(validate "${PAGE:-${_GET[page]}}" '[a-zA-Z0-9_-]+' error)
-[ -x "${_EXEC}/pages/${PAGE}.sh" ] || PAGE="error"
-
-[ -z "$NAVIGATION" ] && NAVIGATION=($(printf %s\\n "${_EXEC}"/pages/*.sh |sed -r 's;^.*/([^/]*)\.sh$;\1;'))
+[ -z "$NAVIGATION" ] \
+&& NAVIGATION=($(printf %s\\n "${_EXEC}"/pages/*.sh |sed -r 's;^.*/([^/]*)\.sh$;\1;'))
 
 CSS="${CSS:-${_EXEC}/templates/${PAGE}.css.sh}"
 BODY="${BODY:-${_EXEC}/templates/${PAGE}.html.sh}"
 
 . "${_EXEC}/pages/${PAGE}.sh"
+
+printf "Content-Type: text/html;charset=utf-8\r\n\r\n"
 . "${_EXEC}/templates/frame.html.sh"