Javascript onbeforeunload
2018-04-19
IN1, 2018-04-19 00:00:00
IN1, 2023-04-10 14:16:29


Javascript Event onbeforeunload is triggered when a page is exited. A browser confirmation dialog is displayed. Here is a function that creates a way to switch the confirmation dialog on and off if required.

Javascript:

/**
 * switches eventlistener to onbeforeunload on/off
 * @see https://blog.ueffing.net/post/2018/04/19/javascript-onbeforeunload/
 * @param boolean bState | default=true (aktiv)
 * @returns boolean
 */
fu […]

php: filter double dot und double slash from String
2018-04-15
IN1, 2018-04-15 00:00:00
IN1, 2023-04-10 14:16:29


Code

/**
 * @param string $sAbsoluteFilePath
 * @return string
 */
function secureFilePath($sAbsoluteFilePath = '')
{
    $sAbsoluteFilePath = removeDoubleDotSlashesFromString($sAbsoluteFilePath);
    $sAbsoluteFilePath = replaceMultipleForwardSlashesByOneFromString($sAbsoluteFilePath);

    /**@var string */
    return $sAbsoluteFilePath;
}

/**
 * @param string $sString
 * @return string
 */
function removeDoubleDotSlashesFromString($sString = '')
{
    […]


This website uses Cookies to provide you with the best possible service. Please see our Privacy Policy for more information. Click the check box below to accept cookies. Then confirm with a click on "Save".