He says he's spending six days in Shanghai then flying to Manila for a half-day.
If his ticket Budapest-Shanghai-Budapest indeed leaves him in Shanghai for less than 144 hours, properly calculated per the rule, then he doesn't have to worry about pulling out the Manila ticket when checking-in at Ferihegy.
Indeed, maybe he doesn't even need to go to Manila at all!