diff options
author | Jesús <heckyel@hyperbola.info> | 2019-11-19 10:56:04 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2019-11-19 10:56:04 -0500 |
commit | 299e3e6c7c0eb0da332030834f0cacd75c00e52b (patch) | |
tree | 2c841fc7a6f9ccc24dc0b78d2cfdc71e236aa4f1 | |
parent | a6be1e73b8802abd7d90895fea09be8c667b92d9 (diff) | |
download | cl-299e3e6c7c0eb0da332030834f0cacd75c00e52b.tar.lz cl-299e3e6c7c0eb0da332030834f0cacd75c00e52b.tar.xz cl-299e3e6c7c0eb0da332030834f0cacd75c00e52b.zip |
Fix Rediret to current post
-rw-r--r-- | cl-theme/templates/article.html | 6 | ||||
-rw-r--r-- | content/vendor/form-comments/commentsubmit.php | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/cl-theme/templates/article.html b/cl-theme/templates/article.html index 1aa0972..6e51293 100644 --- a/cl-theme/templates/article.html +++ b/cl-theme/templates/article.html @@ -227,7 +227,11 @@ <!-- form begin --> <form class="media" id="commentform" method="POST" action="{{ SITEURL }}/vendor/form-comments/commentsubmit.php"> <input type="hidden" name="post_id" value="{{ article.url }}"> - <input type="hidden" name="return_url" value="{{ SITEURL }}/{{ article.url }}" /> + {% if RELATIVE_URLS == False %} + <input type="hidden" name="return_url" value="{{ SITEURL }}/{{ article.url }}" /> + {% else %} + <input type="hidden" name="return_url" value="../../{{ article.url }}" /> + {% endif %} <figure class="media-left"> <p class="image is-64x64"> <img src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/avatar/avatar.png" alt="placeholder"> diff --git a/content/vendor/form-comments/commentsubmit.php b/content/vendor/form-comments/commentsubmit.php index c465a98..fa00d29 100644 --- a/content/vendor/form-comments/commentsubmit.php +++ b/content/vendor/form-comments/commentsubmit.php @@ -23,8 +23,8 @@ if(empty($_POST['name']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) ) { - // header( "Location: ../{$return_url}"); # devel - header( "Location: {$return_url}"); # prod + // Rediret to current post + header( "Location: {$return_url}"); } else { $DATE_FORMAT = "Y-m-d H:i"; @@ -74,8 +74,7 @@ EOT; mail($to,$email_subject,$email_body,$headers); // Rediret to current post - // header("Refresh: 10; URL=../{$return_url}"); # devel - header("Refresh: 10; URL={$return_url}"); # prod + header("Refresh: 10; URL={$return_url}"); printf('Hurra! %s su comentario se envió correctamente, volviendo a la web en 10 segundos...', $name); } |