HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Incorrect photo upload URL

oswxposwxp New
edited December 2014 in Feedback

Hi,

Vanilla ver.: 2.2.16.8

I have a problem. When user uploads any photo, in sql field seems like "M:///userpics/847/A8GQGUZF5RPW.png", with drive name and two slashes "M:///".

When Vanillaforum render links with photo:
_<img src="http://localhost/uploads/M:///userpics/847/nA8GQGUZF5RPW.png"

what line(s) I should fix code?

Comments

  • @oswxp said:
    Hi,

    Vanilla ver.: 2.2.16.8

    I have a problem. When user uploads any photo, in sql field seems like "M:///userpics/847/A8GQGUZF5RPW.png", with drive name and two slashes "M:///".

    When Vanillaforum render links with photo:
    _<img src="http://localhost/uploads/M:///userpics/847/nA8GQGUZF5RPW.png"

    what line(s) I should fix code?

    Is there a reason why you are using version 2.2.16.8 instead of the standard release

    http://vanillaforums.org/addon/vanilla-core

    not many people use 2.2.x - since the recommended version is 2.1

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • This is because the physical path to your www directory isn't set correctly. You seem to be testing on your local windows pc, so this will not happen on a webserver that is configured correctly.

  • @peregrine said:
    not many people use 2.2.x - since the recommended version is 2.1

    We already modified, so we dont want to downgrade.
    Before we launched 2.2.x for test, on early stage it works fine, so we decided to keep it.

    @Bleistivt said:
    This is because the physical path to your www directory isn't set correctly. You seem to be testing on your local windows pc, so this will not happen on a webserver that is configured correctly.

    Ok. And how to fix it. Its now on web (IIS orient -hosting)?
    What source I should change to fix it?

    Thx.

  • We dont want to use our own sql patch to change every 'photo' field for all users.

    upd: Sry, for mine english.

  • R_JR_J Ex-Fanboy Munich Admin

    Maybe you haven't deleted the cache files when you went from localhost tests to an online server?

    /!\ But a) you use alpha software and b) your server does not meet the software requirements and c) you've changed the source code.
    If you really continue using Vanilla under that circumstances, getting support from this community becomes harder and harder and maybe even impossible.

  • @R_J said:
    Maybe you haven't deleted the cache files when you went from localhost tests to an online server?

    /!\ But a) you use alpha software and b) your server does not meet the software requirements and c) you've changed the source code.
    If you really continue using Vanilla under that circumstances, getting support from this community becomes harder and harder and maybe even impossible.

    No, we didnt change this part.
    We tried on 2 servers with different platforms.
    We delete all cache before upload.
    About support, sad too heart, so I gues we shall keep searching in code.

    Upd: we'll try install default version and compare the source code. I thought, u know what part of source code is responsible for this. Anyway thx.

  • BleistivtBleistivt Moderator
    edited December 2014

    For images it is in /library/core/functions.render.php: function Img() which in turn calls SmartAsset() (functions.general.php)

    Yes, install the default version and put all your modifications into plugins or themes.

    If you are modifying the core files you are essentially creating a different version of the software which we obivously can't support.

  • peregrineperegrine MVP
    edited December 2014

    we know your image link is incorrect as you stated,

    However you failed to mention if the image is actually being saved in the folder.

    when using vanilla 2.1.6

    do you see an image in the folder userpics/847/nA8GQGUZF5RPW.png on your server.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • oswxposwxp New
    edited December 2014

    @Bleistivt said:
    For images it is in /library/core/functions.render.php: function Img() which in turn calls SmartAsset() (functions.general.php)

    Yes, install the default version and put all your modifications into plugins or themes.

    If you are modifying the core files you are essentially creating a different version of the software which we obivously can't support.

    Thx, Bleistivt, I'll definitely look.

    @peregrine said:
    we know your image link is incorrect as you stated,

    However you failed to mention if the image is actually being saved in the folder.

    when using vanilla 2.1.6

    do you see an image in the folder userpics/847/nA8GQGUZF5RPW.png on your server.

    Yes, I see. It uploads fine. The problem's only in the DB record (step of recording the variable data), I gues.

  • peregrineperegrine MVP
    edited December 2014

    when you have 2.1.6 installed and if you have the same problem.

    see if you have the same issues with FileUpload for attached files using 1.8.4.1

    also do you have two file for each pic in the uploads userpics file with the name number and an n and a p meaning the pic and a thumbnail of the user pic.

    I believe the saveasimage path is not properly parsed when putting path in tables for at least some IIS servers or possibly all IIS servers not using apache, since no one from the community has commented we will never know if anyone with IIS server has 2.1.6 working properly with path to pic in picture in user table and/or thumbpath in media file

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • oswxposwxp New
    edited January 2015

    @peregrine said:
    when you have 2.1.6 installed and if you have the same problem.

    see if you have the same issues with FileUpload for attached files using 1.8.4.1

    I can test with 1.8.4.1, but we want find a solve for 2.1.6.
    We installed 2.1.6 on local (uses Apache 2.4 ), then upload on hosting with IIS. On local (Apache) and remote(IIS) we have same problem.

    also do you have two file for each pic in the uploads userpics file with the name number and an n and a p meaning the pic and a thumbnail of the user pic.

    We have small ("nJCDVKQI9CD8E.png") and original ("pJCDVKQI9CD8E.png") size of picture in uploaded folder ("userpics/###"). I have a problem only with link, what writes on SQL query.

    I believe the saveasimage path is not properly parsed when putting path in tables for at least some IIS servers or possibly all IIS servers not using apache, since no one from the community has commented we will never know if anyone with IIS server has 2.1.6 working properly with path to pic in picture in user table and/or thumbpath in media file

    So, what part of code I should to change, to fix this issue in 2.1.6 ?

  • oswxposwxp New
    edited January 2015

    Its fixed in 2.1.7, so its was problem in src code of 2.1.6, as I expected.

    "Fix for "u.Photo isn't in GROUP BY" Fatal Error (thx @Shadowdare‌)"

    Anyway, thx peregrine, for trying to help me

Sign In or Register to comment.