Changeset 763 for trunk/lib/App.inc.php


Ignore:
Timestamp:
Feb 24, 2022 10:05:48 PM (2 years ago)
Author:
anonymous
Message:

Include boomerang in hidden input on login form so the user will be redirected if the revisit the login form after session is garbage collected. Add escape values used in html attributes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r762 r763  
    13351335                    foreach ($val as $subval) {
    13361336                        if ('' != $key && '' != $subval) {
    1337                             $out .= sprintf('<input type="hidden" name="%s[]" value="%s" />', $key, $subval);
     1337                            $out .= sprintf('<input type="hidden" name="%s[]" value="%s" />', oTxt($key), oTxt($subval));
    13381338                        }
    13391339                    }
    13401340                } else if ('' != $key && '' != $val) {
    1341                     $out .= sprintf('<input type="hidden" name="%s" value="%s" />', $key, $val);
     1341                    $out .= sprintf('<input type="hidden" name="%s" value="%s" />', oTxt($key), oTxt($val));
    13421342                }
    13431343            }
     
    13551355        && $this->getParam('session_use_trans_sid')
    13561356        ) {
    1357             $out .= sprintf('<input type="hidden" name="%s" value="%s" />', session_name(), session_id());
     1357            $out .= sprintf('<input type="hidden" name="%s" value="%s" />', oTxt(session_name()), oTxt(session_id()));
    13581358        }
    13591359
     
    13611361        // This token can be validated upon form submission with $app->verifyCSRFToken() or $app->requireValidCSRFToken()
    13621362        if ($this->getParam('csrf_token_enabled') && $include_csrf_token) {
    1363             $out .= sprintf('<input type="hidden" name="%s" value="%s" />', $this->getParam('csrf_token_name'), $this->getCSRFToken());
     1363            $out .= sprintf('<input type="hidden" name="%s" value="%s" />', oTxt($this->getParam('csrf_token_name')), oTxt($this->getCSRFToken()));
    13641364        }
    13651365
     
    15301530        } else {
    15311531            // Fallback: die using meta refresh instead.
    1532             printf('<meta http-equiv="refresh" content="0;url=%s" />', $url);
     1532            printf('<meta http-equiv="refresh" content="0;url=%s" />', oTxt($url));
    15331533            $this->logMsg(sprintf('dieURL (refresh): %s; headers already sent (output started in %s : %s)', $url, $h_file, $h_line), LOG_NOTICE, __FILE__, __LINE__);
    15341534        }
Note: See TracChangeset for help on using the changeset viewer.