openbsd-ports/net/php-weathermap/patches/patch-editor_php
sthen 69acda4c73 update to php-weathermap 0.97c; various fixes including SECURITY fixes
to improve input validation in the editor (which is not enabled by default)
2013-04-22 14:05:07 +00:00

36 lines
1.4 KiB
Plaintext

$OpenBSD: patch-editor_php,v 1.2 2013/04/22 14:05:07 sthen Exp $
Allow editor to be enabled via a config file rather than editing the
editor.php script itself.
--- editor.php.orig Mon Apr 22 13:41:26 2013
+++ editor.php Mon Apr 22 13:41:34 2013
@@ -6,13 +6,6 @@ require_once 'lib/Weathermap.class.php';
// so that you can't have the editor active, and not know about it.
$ENABLED=false;
-if(! $ENABLED)
-{
- print "<p>The editor has not been enabled yet. You need to set ENABLED=true at the top of editor.php</p>";
- print "<p>Before you do that, you should consider using FilesMatch (in Apache) or similar to limit who can access the editor. There is more information in the install guide section of the manual.</p>";
- exit();
-}
-
// sensible defaults
$mapdir='configs';
$cacti_base = '../../';
@@ -21,6 +14,13 @@ $ignore_cacti=FALSE;
$configerror = '';
$config_loaded = @include_once 'editor-config.php';
+
+if(! $ENABLED)
+{
+ print "<p>The editor has not been enabled yet. You need to set ENABLED=true at the top of editor-config.php</p>";
+ print "<p>Before you do that, you should consider using FilesMatch (in Apache) or similar to limit who can access the editor. There is more information in the install guide section of the manual.</p>";
+ exit();
+}
// these are all set via the Editor Settings dialog, in the editor, now.
$use_overlay = FALSE; // set to TRUE to enable experimental overlay showing VIAs