I find the solution rather "nasty" (why use strtok on the full querystring if you could do URL->getParameter to extract the category name from the querystring). But worse: it won't work well on pages with special characters.
Example: for url "/zh/博客", getURLForBlock() will return the non-urlencoded "/zh/博客", while URL->getQueryString() will return "zh/%E5%8D%9A%E5%AE%A2".
As a result, the $pageUrl == $row['url'] comparison won't be accurate.

I'd rather suggest an approach like this:

    $extras = Spoon::get('page')->getExtras();
    foreach($extras as $extra)
    {
    	// find blog block
    	if($extra instanceof FrontendBlockExtra && $extra->getModule() == 'blog')
    	{
    		// category
    		if($extra->getAction() == 'category')
    		{
    			/*
    			 * At this point, we know that:
    			 * * the blog module is attached to this page
    			 * * that the category action is currently active
    			 *
    			 * Since that class (will be|has been) executed & already has the code to figure
    			 * out what category should be loaded, why not access the data from there, like this:
    			 */
    			$activeCategory = FrontendBlogCategory::getCategory();
    
    			/*
    			 * @todo: all this would require us to do is create this method in FrontendBlogCategory,
    			 * which should contain the first 16 lines of what's currently in getData(), so that it
    			 * can be called from both getData and from here (which only needs to process once and
    			 * then the result can be saved in a static variable)
    			 */
    
    			/*
    			 * @todo: Alternatively (and even better): in FrontendBlockExtra, a public method ->getObject()
    			 * could be created, that would allow us to directly call $extra->getObject()->getCategory()
    			 * (effectively getting rid of the less favorable static function)
    			 */
    		}
    		elseif($extra->getAction() == 'detail')
    		{
    			/*
    			 * @todo: you can even work out a way to set the active category based on which category the
    			 * currently active article is in.
    			 */
    		}
    	}
    
    	foreach($categories as &$row)
    	{
    		$row['url'] = $link . '/' . $row['url'];
    		$row['active'] = $row['id'] == $activeCategory['id'];
    	}
    }