From a77d63fd3ce1e93a554b62e6f63646f1fb568ecb Mon Sep 17 00:00:00 2001 From: lpouzenc Date: Thu, 28 Nov 2013 13:11:58 +0100 Subject: Import initial --- internal/editor-bind-code.html | 71 ++++++++++++++++++++++++++++++++++++++++++ internal/utils.php | 39 +++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 internal/editor-bind-code.html create mode 100644 internal/utils.php (limited to 'internal') diff --git a/internal/editor-bind-code.html b/internal/editor-bind-code.html new file mode 100644 index 0000000..915d55c --- /dev/null +++ b/internal/editor-bind-code.html @@ -0,0 +1,71 @@ + + + + + + + + + diff --git a/internal/utils.php b/internal/utils.php new file mode 100644 index 0000000..c9f8320 --- /dev/null +++ b/internal/utils.php @@ -0,0 +1,39 @@ + $v ) { + if ( array_key_exists($k, $array_entry_props) + && array_key_exists('replace_chars_re', $array_entry_props[$k]) + &&| array_key_exists('default_value', $array_entry_props[$k]) + ) { + $arr[$k] = sanitize($arr, $k, + $array_entry_props[$k]['replace_chars_re'], + $array_entry_props[$k]['default_value'] ); + } else { + unset($arr[$k]); + } + } + } + return $arr; + } + + define('SANITIZE_SITE_CONF', array( + 'default_page' => array( 'replace_chars_re' => '/[^a-z0-9\/]+/', 'default_value' => 'en/index' ), + ) + ); + + define('SANITIZE_PAGE_PROPS', array( + 'title' => array( 'replace_chars_re' => '/[^.]+/', 'default_value' => '(missing title in props.ini)' ), + 'template' => array( 'replace_chars_re' => '/[^a-z0-9]+/', 'default_value' => 'default' ), + 'layout' => array( 'replace_chars_re' => '/[^a-z0-9]+/', 'default_value' => 'article' ), + ) + ); + +?> + -- cgit v1.2.3