diff --git a/.htaccess b/.htaccess index 422199c..0639402 100644 --- a/.htaccess +++ b/.htaccess @@ -39,6 +39,8 @@ RewriteRule ^en/(.*)$ /$1 [QSA] RewriteRule ^fr/(.*)$ /$1 [QSA] RewriteRule ^lb/(.*)$ /$1 [QSA] +# Honeypots. (Just to fuck with automated scanners, gotta love those unsolicited emails tho...) + # Sending a 404 for git and IDEs folders just in case they ever get copied to the web server, # or if one of the honeypot files is acessed directly. # A 404 is preferred to prevent further scanning of this folder and from raising some flags. diff --git a/commons/content.php b/commons/content.php index 97e8762..f8186a5 100644 --- a/commons/content.php +++ b/commons/content.php @@ -165,19 +165,21 @@ function printErrorTextElement(string $text) : void { } } -function processStandardContentSubNode(mixed $elementNode) : void { +function processStandardContentSubNode(mixed $elementNode, string $prepend="", string $append="") : void { if(array_key_exists("content", $elementNode)) { if (array_key_exists("parts", $elementNode["content"])) { for ($iPart = 0; $iPart < count($elementNode["content"]["parts"]); $iPart++) { + echo($prepend); createElementNode($elementNode["content"]["parts"][$iPart]); + echo($append); } } else { - echo(getContentItemText($elementNode["content"], false, true)); + echo($prepend.getContentItemText($elementNode["content"], false, true).$append); } } } -function createElementNode(mixed $elementNode) : void { +function createElementNode(mixed $elementNode, string $prepend="", string $append="") : void { // Checking if we actually have a JSON object. if(!is_array($elementNode)) { echo('
Not array node !
'); @@ -199,6 +201,23 @@ function createElementNode(mixed $elementNode) : void { // Adding element. echo(''); + break; + case "hr": + // Reading and processing the modifiers. + $_modIsSubtle = false; + if(array_key_exists("modifiers", $elementNode)) { + for ($i = 0; $i < count($elementNode["modifiers"]); $i++) { + if ($elementNode["modifiers"][$i] == "subtle") { + $_modIsSubtle = true; + } + } + } + + if($_modIsSubtle) { + echo(''); + echo('
'); // Adding content. processStandardContentSubNode($elementNode); @@ -283,13 +314,19 @@ function createElementNode(mixed $elementNode) : void { } // Reading and processing the modifiers. + $_modIsCard = false; $_modNoTopMargin = false; $_modNoTopPadding = false; $_modNoBottomPadding = false; $_modNoSizePadding = false; + $_modHorizontalScroll = false; if(array_key_exists("modifiers", $elementNode)) { for ($i = 0; $i < count($elementNode["modifiers"]); $i++) { switch($elementNode["modifiers"][$i]) { + case "card": + $_modIsCard = true; + $_modNoTopMargin = true; + break; case "no-top-margin": $_modNoTopMargin = true; break; @@ -302,13 +339,17 @@ function createElementNode(mixed $elementNode) : void { case "no-side-padding": $_modNoSizePadding = true; break; + case "horizontal-scroll": + $_modHorizontalScroll = true; + break; } } } // Opening container. - echo('