Changeset 3091


Ignore:
Timestamp:
10/07/11 16:07:03 (3 years ago)
Author:
benjamin
Message:

fix 2 bugs : didn't allow %% in folder names, and fix issue when using & in redirect urls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • alternc/branches/stable-1.0/src/functions_hosting.sh

    r3087 r3091  
    8484    cp "$TEMPLATE" "$TMP_FILE" 
    8585 
     86    # Substitute special characters :  
     87    FQDN2="`echo $FQDN | sed -e 's/\\\\/\\\\\\\\/g' -e 's/#/\\\\#/g' -e 's/&/\\\\\\&/g'`" 
     88    DOCUMENT_ROOT2="`echo $DOCUMENT_ROOT | sed -e 's/\\\\/\\\\\\\\/g' -e 's/#/\\\\#/g' -e 's/&/\\\\\\&/g'`" 
     89    ACCOUNT_ROOT2="`echo $ACCOUNT_ROOT | sed -e 's/\\\\/\\\\\\\\/g' -e 's/#/\\\\#/g' -e 's/&/\\\\\\&/g'`"        
     90    REDIRECT2="`echo $REDIRECT | sed -e 's/\\\\/\\\\\\\\/g' -e 's/#/\\\\#/g' -e 's/&/\\\\\\&/g'`" 
     91 
    8692    # Put the good value in the conf file 
    8793        sed -i \ 
    88         -e "s#%%fqdn%%#$FQDN#g" \ 
    89         -e "s#%%document_root%%#$DOCUMENT_ROOT#g" \ 
    90         -e "s#%%account_root%%#$ACCOUNT_ROOT#g" \ 
    91         -e "s#%%redirect%%#$REDIRECT#g" \ 
     94        -e "s#%%fqdn%%#$FQDN2#g" \ 
     95        -e "s#%%document_root%%#$DOCUMENT_ROOT2#g" \ 
     96        -e "s#%%account_root%%#$ACCOUNT_ROOT2#g" \ 
     97        -e "s#%%redirect%%#$REDIRECT2#g" \ 
    9298        $TMP_FILE 
    9399 
    94100    # Check if all is right in the conf file 
    95101    # If not, put a debug message 
    96     local ISNOTGOOD=$(grep "%%" "$TMP_FILE")  
    97     [ "$ISNOTGOOD" ] && (echo "# There was a probleme in the generation : $ISNOTGOOD" > "$TMP_FILE" ; return 44 ) 
     102# NO : redirect and document_root COULD contains legitimate %% expressions (...)  
     103#    local ISNOTGOOD=$(grep "%%" "$TMP_FILE")  
     104#    [ "$ISNOTGOOD" ] && (echo "# There was a probleme in the generation : $ISNOTGOOD" > "$TMP_FILE" ; return 44 ) 
    98105 
    99106    # Put the conf file in prod 
Note: See TracChangeset for help on using the changeset viewer.