Skip to content

Conversation

@MyvTsv
Copy link

@MyvTsv MyvTsv commented Nov 12, 2025

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

Apply these fixes for GLPI 11 compatibility

#41
#50
#51

Screenshots (if appropriate):

image

@MyvTsv MyvTsv requested review from Rom1-B and stonebuzz November 12, 2025 15:42
@MyvTsv MyvTsv self-assigned this Nov 12, 2025
Comment on lines +401 to +411
// Remove ALL width styles from elements (including px, %, em, etc.)
$html = preg_replace('/\bwidth\s*:\s*[^;"\'>]+;?/i', '', $html);

// Remove ALL height styles from elements
$html = preg_replace('/\bheight\s*:\s*[^;"\'>]+;?/i', '', $html);

// Remove width attributes from any tag
$html = preg_replace('/(<[^>]+)\s+width\s*=\s*["\']?[^"\'\s>]+["\']?/i', '$1', $html);

// Remove height attributes from any tag
$html = preg_replace('/(<[^>]+)\s+height\s*=\s*["\']?[^"\'\s>]+["\']?/i', '$1', $html);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For tables, it’s best to limit changes to what is strictly necessary and to make targeted modifications, even if it means adding further adjustments later. For instance, downsized images might lose their formatting if all size properties are removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants