I'm wondering how safe this is to make and to build into my setup. :P A bit afraid of it exploding. http://www.apartmenttherapy.com/make-your-own-batterypowered-u-100359
Mechanically there is a risk of shorting.
If it gets hot under discharge as hot-melt glue, which they use, may soften and allow movement.
Shorting the battery terminals will probably not cause a fire, but may.
Explosion is very unlikely.
If you short 9VDC or even >> 5VDC to a USB port it MAY kill the device being charged.
Electrically it is marginal as there are no capacitors used with the regulator but it will probably work in some cases. See the circuit here that robomon cites. Regulator is IC2 at top left. Note the added caps. A 0.1 uF on input will probably be enough. Much larger is useful when battery is low.
The regulator type is not specified (that I could see) but is probably a '7805' / LM340.
This will stop working when the battery reaches about 7V.
Other regulators with the same pinout are available that will operate down to Vbattery < 6V, when the battery will be fully exhausted if an Alkaline battery is used.
Use with a NiCd or NimH battery will not allow all the battery energy to be used in many cses as Vbattery falls too low while there is still energy left in it.
The energy capacity of a 9V PP3 battery is low. This would act as an emergency supply for eg a cellphone but would not fully charge even a very small cellphone battery. Maximum current will not be enough for some larger battery-capacity devices.
As they say, some (or many) USB charged devices require additional resistor dividers that provide selected voltages to the USB data lines to signal charger capability to the charged device. Many Apple devices need these.
There is no danger in the circuit apart from mis-wiring it or creating a short that can feed the 9v of the battery to a 5v USB device and destroy it.
The circuit is just a simple linear regulator (seems like a LM7805) connected to the battery, if the input is >=7v then the output will be 5v.
Possible improvements include the addition of a capacitor to the output, refer to the datasheet.
Note that the output of the regulator has short circuit protection.
If you intend to charge a cell phone you will not get much of a charge becasue the 9v battery has very low capacity.
There is no issue in building this circuit. There won't be any issues of explosion.
Similar circuits is being used in many places. For example: Arduino development board has a 5V regulator which can be fed using a DC barrel jack. The source connected to this DC barrel jack can be a 9V battery similar as yours. This setup is used to run Arduino in battery mode.
Project link - http://arduino.cc/en/Main/ArduinoBoardSerialSingleSided3