View Issue Details

IDProjectCategoryView StatusLast Update
0004867OXID eShop (all versions)4.07. Source code, Testpublic2023-11-17 13:55
Reporterunited20 Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionwon't fix 
Summary0004867: Trim whitespaces in oxConfig::checkParamSpecialChars()
DescriptionIn some cases it is usefull to trim all whitespaces in oxConfig::checkParamSpecialChars()
Additional InformationModified code:

public function checkParamSpecialChars( & $sValue, $aRaw = null )
{
    if ( is_object( $sValue ) ) {
        return $sValue;
    }

    if ( is_array( $sValue ) ) {
        $newValue = array();
        foreach ( $sValue as $sKey => $sVal ) {
            $sValidKey = $sKey;
            if ( !$aRaw || !in_array($sKey, $aRaw) ) {
                $this->checkParamSpecialChars( $sValidKey );
                $this->checkParamSpecialChars( $sVal );
                if ($sValidKey != $sKey) {
                    unset ($sValue[$sKey]);
                }
            }
            $newValue[$sValidKey] = trim( $sVal );
        }
        $sValue = $newValue;
    } elseif ( is_string( $sValue ) ) {
        $sValue = str_replace( array( '&', '<', '>', '"', "'", chr(0), '\\' ),
                               array( '&', '<', '>', '"', ''', '', '\' ),
                               trim( $sValue ) );
    }
    return $sValue;
}
TagsNo tags attached.
ThemeNot defined
BrowserAll
PHP VersionNot defined
Database VersionNot defined

Activities

SvenBrunk

2023-11-17 13:55

administrator   ~0015792

"In some cases"? Which ones? I would not consider this as bug if it is only "useful" under certain circumstances. And for a feature, I would need a usecase (and probably a better way to control this)