Whitley had made a good start to his second loan spell at Conference North Scarborough, keeping two clean sheets in their first first three matches, but is now expected to be between the posts for the Minstermen at Dorking Wanderers on Saturday.
The visitors could hand a debut to Dan Pybus after the defensive midfielder left York to sign a three-year contract on Tuesday.
Stockdale, signed on a free transfer from Sheffield Wednesday at the end of last season, came off at half-time in Saturday's 2-2 draw with Aldershot Town.
Whitley spent the 2021-22 season on loan at Scarborough, who won promotion to Conference North via the play-offs. He then returned to York and sat on the bench as they won promotion out of the division via its play-offs.
The 23-year-old made 15 starts for York last season.