diff --git a/webbuild/webbuild-cgi b/webbuild/webbuild-cgi index 6334f8a..b0e47bc 100755 --- a/webbuild/webbuild-cgi +++ b/webbuild/webbuild-cgi @@ -211,7 +211,7 @@ fi # Public requests # if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshsocial" -o ! "$USER" ]; then - if [ "$WEBBUILD_URL" -a "$USER" ]; then + if [ "$WEBBUILD_URL" -a "$USER" -a "${WEBBUILD_URL/\/localhost\//}" = "$WEBBUILD" ]; then curl -s "$WEBBUILD_URL?REQUEST=refreshsocial&USER=$USER&SECRET=`cgi_encodevar \"$USER_SECRET\"`&USER_EMAIL=$USER_EMAIL&FROMID=$FROMID" else [ -e "$WEBBUILD_STATEDIR/social_log" ] || exit diff --git a/webbuild/webbuild-functions b/webbuild/webbuild-functions index ce43e00..66378af 100644 --- a/webbuild/webbuild-functions +++ b/webbuild/webbuild-functions @@ -37,7 +37,8 @@ function social_log() { set_user_state_var STATE_SOCIALLOG_ID $STATE_SOCIALLOG_ID webbuild echo "SID=$STATE_SOCIALLOG_ID SPRIVACY=$STATE_PRIVACYMODE $line" >> $WEBBUILD_STATEDIR/social_log - if [ "$WEBBUILD_URL" ]; then + # Note: checking that URL does not point here again to avoid recursive requests + if [ "$WEBBUILD_URL" -a "${WEBBUILD_URL/\/localhost\//}" = "$WEBBUILD_URL" ]; then eval $line USER_SECRET_FIXED=`echo $USER_SECRET | sed "s|\$|\\$|"` curl -s "$WEBBUILD_URL?REQUEST=message&USER=$USER&SECRET=`cgi_encodevar \"$USER_SECRET\"`&USER_EMAIL=$USER_EMAIL&\