Merge pull request #439 from Th3R3p0/CSRF-Fix

fixed CSRF issue
This commit is contained in:
Claude 2017-08-28 15:08:14 +02:00 committed by GitHub
commit 085de303e0
6 changed files with 49 additions and 0 deletions

View File

@ -125,6 +125,14 @@
<i class="icon-pencil icon-white"></i>
<?php echo lang('paste_create'); ?>
</button>
<?php
if ($this->config->item('csrf_protection') === TRUE)
{
if(isset($_COOKIE[$this->config->item('csrf_cookie_name')])) {
echo '<input type="hidden" name="'.$this->config->item('csrf_token_name').'" value="'.html_escape($_COOKIE[$this->config->item('csrf_cookie_name')]).'" style="display:none;" />'."\n";
}
}
?>
</div>
</form>
</div>

View File

@ -133,5 +133,13 @@
<div><button type="submit" value="submit" name="submit"><?php echo lang('paste_create'); ?></button></div>
<div class="spacer"></div>
<?php
if ($this->config->item('csrf_protection') === TRUE)
{
if(isset($_COOKIE[$this->config->item('csrf_cookie_name')])) {
echo '<input type="hidden" name="'.$this->config->item('csrf_token_name').'" value="'.html_escape($_COOKIE[$this->config->item('csrf_cookie_name')]).'" style="display:none;" />'."\n";
}
}
?>
</form>
</div>

View File

@ -131,6 +131,15 @@
?>
<div class="clear"><button type="submit" value="submit" name="submit"><?php echo lang('paste_create'); ?></button></div>
<?php
if ($this->config->item('csrf_protection') === TRUE)
{
if(isset($_COOKIE[$this->config->item('csrf_cookie_name')])) {
echo '<input type="hidden" name="'.$this->config->item('csrf_token_name').'" value="'.html_escape($_COOKIE[$this->config->item('csrf_cookie_name')]).'" style="display:none;" />'."\n";
}
}
?>
<div class="spacer"></div>
</form>
</div>

View File

@ -132,6 +132,14 @@
<?php echo lang('paste_create'); ?>
</button>
</div>
<?php
if ($this->config->item('csrf_protection') === TRUE)
{
if(isset($_COOKIE[$this->config->item('csrf_cookie_name')])) {
echo '<input type="hidden" name="'.$this->config->item('csrf_token_name').'" value="'.html_escape($_COOKIE[$this->config->item('csrf_cookie_name')]).'" style="display:none;" />'."\n";
}
}
?>
</form>
</div>
</div>

View File

@ -134,6 +134,14 @@
<i class="icon-pencil icon-white"></i>
<?php echo lang('paste_create'); ?>
</button>
<?php
if ($this->config->item('csrf_protection') === TRUE)
{
if(isset($_COOKIE[$this->config->item('csrf_cookie_name')])) {
echo '<input type="hidden" name="'.$this->config->item('csrf_token_name').'" value="'.html_escape($_COOKIE[$this->config->item('csrf_cookie_name')]).'" style="display:none;" />'."\n";
}
}
?>
</div>
</form>
</div>

View File

@ -134,6 +134,14 @@
<?php echo lang('paste_create'); ?>
</button>
</div>
<?php
if ($this->config->item('csrf_protection') === TRUE)
{
if(isset($_COOKIE[$this->config->item('csrf_cookie_name')])) {
echo '<input type="hidden" name="'.$this->config->item('csrf_token_name').'" value="'.html_escape($_COOKIE[$this->config->item('csrf_cookie_name')]).'" style="display:none;" />'."\n";
}
}
?>
</form>
</div>
</div>