Limpiar las rutas de almacenamiento de AiScan eliminando aiscan_tmp#39
Closed
Copilot wants to merge 1 commit into
Closed
Limpiar las rutas de almacenamiento de AiScan eliminando aiscan_tmp#39Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
Copilot
AI
changed the title
[WIP] Refactor storage folder structure to avoid tmp
Clean up AiScan storage paths by removing May 18, 2026
aiscan_tmp
FacturaScripts Playground Preview
Try this PR in your browser This preview is generated automatically for the |
1 similar comment
FacturaScripts Playground Preview
Try this PR in your browser This preview is generated automatically for the |
c600c7f to
6268504
Compare
Replace the confusing 'aiscan_tmp' MyFiles subfolder with 'aiscan' so imported attachments no longer look temporary in the file library (#36). - Add StoragePathHelper to centralize the storage path and sanitize file names with basename() (defense against path traversal). - Route every aiscan_tmp reference (controller, AttachmentService, ExtractionService) through the helper. - Stabilize the MIME fallback controller test with deterministic content. - Complete the LGPL headers on the new files to match the project standard.
6268504 to
de55df7
Compare
aiscan_tmp
Owner
|
Se cierra en favor del #29. Ambos abordan la misma zona (cómo almacena AiScan los adjuntos en
Como efecto colateral, el #29 también hace que los adjuntos dejen de aparecer bajo |
This was referenced May 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resuelve el #36: los ficheros importados aparecían en la biblioteca bajo la carpeta
aiscan_tmp/, cuyo sufijo_tmpdaba a entender que eran temporales y podía generar dudas.Qué hace
Cambia la carpeta de almacenamiento de
MyFiles/aiscan_tmp/aMyFiles/aiscan/, de modo que los adjuntos importados se vean claramente como originados por AiScan, sin el confuso_tmp(a pesar del nombre, esa carpeta siempre fue el almacenamiento real de los adjuntos, no algo temporal).Cómo
Lib/StoragePathHelperque centraliza la ruta en un único sitio (constanteaiscan) y expone helpers para la ruta absoluta del directorio, la ruta absoluta de un fichero y la ruta relativa que se guarda enAttachedFile->path.aiscan_tmp(controlador,AttachmentService,ExtractionService) pasan ahora por el helper — cero rutas hardcodeadas.basename(), saneando el nombre como defensa frente a path traversal.Notas
MyFiles/aiscan_tmp/y sus registros siguen apuntando ahí (siguen funcionando); solo las nuevas importaciones usanaiscan/.StoragePathHelper(ruta limpia + saneamiento de entradas anidadas). Verificado en CI (lint + suite PHPUnit) en PHP 8.1–8.5.Este PR solapa y compite con el #29 (issue #28, token
myftinválido en JPG/JPEG): ambos modificanLib/AttachmentService.phpy la estrategia de almacenamiento. #29 propone mover los adjuntos a la raíz deMyFiles/(como el core), lo que arreglaría el token JPG y de paso eliminaría la carpetaaiscan_tmp— haciendo innecesario este PR. Conviene decidir la estrategia (subcarpetaaiscan/vs. raíz) antes de mezclar cualquiera de los dos.Closes #36