• Iaki Arenaza's avatar
    MAH-3317 Cannot Login to Mahara from Moodle When Picture is added to Moodle Profile · a3d82f91
    Iaki Arenaza authored
    Instead of using a fixed platform-specific path for temporary image files,
    create a new temporary directory inside dataroot and place temporary files
    In addition to it, make sure we prefix the profile icon file names with 'mpi_'
    (stands for mnet profile icon) to prevent clashes (as per Nigel's suggestion)
    and check the return result from file_put_contents() for errors (but otherwise
    and continue gracefully if the file can't be written, as Nigel suggested on the
    bug tracker).
    While in this particular case the related code takes care of the temporary
    files, if we are going to have a temp directory, it might be good to have a
    cronjob to clean it out (We should file a bug to remind us to do that)
    [Minor whitespace fixups by Nigel]
    Signed-off-by: default avatarIñaki Arenaza <iarenaza@eps.mondragon.edu>
    Signed-off-by: default avatarNigel McNie <nigel@catalyst.net.nz>