Skip to content

Instantly share code, notes, and snippets.

@msankhala
Created May 27, 2026 09:22
Show Gist options
  • Select an option

  • Save msankhala/1ad5dd3148ef575abc56a31f76bd538c to your computer and use it in GitHub Desktop.

Select an option

Save msankhala/1ad5dd3148ef575abc56a31f76bd538c to your computer and use it in GitHub Desktop.
drupal-css-aggregated-css-files.php
// Drupal creates aggregated CSS file based on URL. The URL of aggreated css files looks like this.
// /sites/default/files/css/css_r2mI5EYphoR4On2HmnhByWxu6QR1_AhZ5GtagUZw2aE.css?delta=1&language=en&theme=particle&include=eJxtUttyxCAI_SG7vuz_MMQQl6yKFdJp-vUlO53upX1RDiAHDqIqGXBbKZmMuGrUxaHRwGQsDdS2mQXog0bGTAH_PrjgILuwgqbB3UJKC3QaKg0Lf-FRJvYhVWDh4pXDIqMedepU9vgIYNWQRXIhMMwHaTON5r1cueXQpZQ4j61jOR32W-F21aC7GtU4oVLoOIxToZhkUFjfNxo7bAwmUox7_LlvPSaRKxN0d8UX7JWngWO_5WWEbDXezZfo-SF8forfZ4nufoaYX_EJV_wM6Uozu7SAyWeYD_F-rdMyxHfT5rCqt1u7NFfoRo0M6YI2iZ3uZvAo2w4uLs0xYT92cdeoOhPChK35UgYl7uQrajM5-VzZiY_zpt2EA9KmJtV_xF5I_82v1Db4YOWJi_N-AwqU7mo
// Where include parameter decides what all the files to include in aggregated css. You can decode this with below script.
$include_param = 'eJxtUt16wyAIfSFXb_o-fESJIzWSAXbL28_069at241yOPzIQTQjB24LJReNi0WbB3RSTM7SwLxnFqAracFCAf8mvKKSv7KBJeXNwyy6HmHrVPf4E8BioYiUSuBYjprNLfpodeFWwia1xqx9w3o67JfK7WLBdnNa44RGYUN1TpViEqWwvHXSHTqDi1TnLd7vkNIMSeTCBNtwxSc8Kk-Kut_iCkLxNT7MJ_b8gz7_4h-zxOH-DbE84xMu-BHShTIP5QDTmGFI2-K3dZpVhvQth4q7dIepc82k0d8lSQWj204eKvCUYav00Q1Wav0rLbMlGQvbozQaiXc5lGKdIJnBQSpnCkqJN4KZ22gDmFcezznOm6ITKqRuLuv4Bnsl-zf-6AxXNp64su-fgXzqnA';
// Method 1: Try gzinflate
$base64 = strtr($include_param, '-_', '+/');
$decoded = base64_decode($base64);
echo "Decoded length: " . strlen($decoded) . "\n";
$result1 = @gzinflate($decoded);
echo "Method 1 (gzinflate): " . ($result1 ? "Success" : "Failed") . "\n";
// Method 2: Try gzuncompress
$result2 = @gzuncompress($decoded);
echo "Method 2 (gzuncompress): " . ($result2 ? "Success" : "Failed") . "\n";
// Method 3: Try gzdecode (for gzip format)
$result3 = @gzdecode($decoded);
echo "Method 3 (gzdecode): " . ($result3 ? "Success" : "Failed") . "\n";
// Method 4: No compression - just decode
echo "Method 4 (raw decode): \n";
var_dump($decoded);
// Method 5: Try with padding
$padded = $base64 . str_repeat('=', (4 - strlen($base64) % 4) % 4);
$decoded_padded = base64_decode($padded);
$result5 = @gzinflate($decoded_padded);
echo "Method 5 (with padding): " . ($result5 ? "Success" : "Failed") . "\n";
// Print whichever worked
if ($result1) echo "Result 1:\n" . $result1 . "\n";
if ($result2) echo "Result 2:\n" . $result2 . "\n";
if ($result3) echo "Result 3:\n" . $result3 . "\n";
if ($result5) echo "Result 5:\n" . $result5 . "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment