Hardcoded filepath in generated php files in /modules/AOS_PDF_Templates/PDF_Lib/ttfonts/ #4592

Open
opened 2026-02-20 16:20:14 -05:00 by deekerman · 0 comments
Owner

Originally created by @LeoZandvliet on GitHub (Jul 15, 2021).

Issue

Creation of *.php files containing complete filepath in directory:
/public_html/modules/AOS_PDF_Templates/PDF_Lib/ttfontdata/

The following php files are created there:

  • dejavusanscondensed.cw127.php
  • dejavusanscondensed.mtx.php
  • dejavusanscondensedB.mtx.php
  • dejavusanscondensedBI.mtx.php

My issue is that they contain the full path to a font file, instead of a relative path.

Snippet of a file above:

<?php
$name='DejaVuSansCondensed-BoldOblique';
$type='TTF';
...
$ttffile='/var/www/myfakedomain/public_html/modules/AOS_PDF_Templates/PDF_Lib/ttfonts/DejaVuSansCondensed-BoldOblique.ttf';

Expected Behavior

A 'dynamic' absolute file path so it won't bother GIT repository

Example:

$ttffile=realpath( dirname( __FILE__ ) . '../ttfonts/DejaVuSansCondensed-BoldOblique.ttf');

Actual Behavior

The full path as string is put in the generated php files.
The files itself are not ignored and appear as untracked files:

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	modules/AOS_PDF_Templates/PDF_Lib/ttfontdata/dejavusanscondensed.cw.dat
	modules/AOS_PDF_Templates/PDF_Lib/ttfontdata/dejavusanscondensed.mtx.php

Possible Fix

  1. See expected behavior
  2. Or, exclude the files *.cw.dat and *.mtx.php in directory "modules/AOS_PDF_Templates/PDF_Lib/ttfontdata" from git ?

Steps to Reproduce

I can't find code that these ttfontdata files actually creates.
After a fresh Suitecrm v7.11.20 install, one did appear after creating a pdf template and printing a Quote with it.

Context

Using GIT

Your Environment

  • SuiteCRM Version used: v7.11.8 & v7.11.20
  • Environment name and version (e.g. MySQL, PHP 7): PHP 7.3 & v7.4
  • Operating System and version (e.g Ubuntu 16.04): CentOS 7 & Ubuntu 18
Originally created by @LeoZandvliet on GitHub (Jul 15, 2021). #### Issue Creation of *.php files containing complete filepath in directory: /public_html/modules/AOS_PDF_Templates/PDF_Lib/ttfontdata/ The following php files are created there: - dejavusanscondensed.cw127.php - dejavusanscondensed.mtx.php - dejavusanscondensedB.mtx.php - dejavusanscondensedBI.mtx.php My issue is that they contain the full path to a font file, instead of a relative path. Snippet of a file above: ``` <?php $name='DejaVuSansCondensed-BoldOblique'; $type='TTF'; ... $ttffile='/var/www/myfakedomain/public_html/modules/AOS_PDF_Templates/PDF_Lib/ttfonts/DejaVuSansCondensed-BoldOblique.ttf'; ``` #### Expected Behavior A 'dynamic' absolute file path so it won't bother GIT repository Example: ```$ttffile=realpath( dirname( __FILE__ ) . '../ttfonts/DejaVuSansCondensed-BoldOblique.ttf');``` #### Actual Behavior The full path as string is put in the generated php files. The files itself are not ignored and appear as untracked files: ``` Untracked files: (use "git add <file>..." to include in what will be committed) modules/AOS_PDF_Templates/PDF_Lib/ttfontdata/dejavusanscondensed.cw.dat modules/AOS_PDF_Templates/PDF_Lib/ttfontdata/dejavusanscondensed.mtx.php ``` #### Possible Fix 1. See expected behavior 2. Or, exclude the files *.cw.dat and *.mtx.php in directory "modules/AOS_PDF_Templates/PDF_Lib/ttfontdata" from git ? #### Steps to Reproduce I can't find code that these ttfontdata files actually creates. After a fresh Suitecrm v7.11.20 install, one did appear after creating a pdf template and printing a Quote with it. #### Context Using GIT #### Your Environment * SuiteCRM Version used: v7.11.8 & v7.11.20 * Environment name and version (e.g. MySQL, PHP 7): PHP 7.3 & v7.4 * Operating System and version (e.g Ubuntu 16.04): CentOS 7 & Ubuntu 18
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#4592
No description provided.