In this answer I wanted to alter a URL using hook_file_url_alter()
, and within my implementation of that hook I needed to convert the URI to a URL.
Normally this would be done with a call to file_create_url()
but that is not possible here as it would trigger my hook causing an endless loop.
I can see at the top of drupal_alter()
it is using the static variable $drupal_static_fast
which makes me think maybe there is a way of using this to temporarily disable a hook being called, but I'm not sure.