Slick proof $\mathcal M^\perp$ is limit-stable (strong factorization systems) Theorem 1.17 of Emily Riehl's Factorization Systems says that given a class of maps $\mathcal M$, $\mathcal M^\perp$ is closed under limits and dually  $^\perp\mathcal M$ is closed under colimits.
The argument for the former is as follows.

Given two arrows $e,m$, the square below always commutes.
$$\require{AMScd} \begin{CD} \mathsf{Hom}(B,X) @>{e^\ast}>>
 \mathsf{Hom}(A,X)\\ @V{m_\ast}VV @VV{m_\ast}V\\ \mathsf{Hom}(B,Y)
 @>>{e^\ast}> \mathsf{Hom}(A,Y) \end{CD}$$
This assignment is functorial in $e,m$, yielding a functor
$$S:(\mathsf C^\text{op})^2\times \mathsf C^2\longrightarrow
 \mathsf{Set}^{2\times 2}$$
that is continuous in each variable. $m\in \mathcal M^\perp$ iff
  $S(e,m)$ is a pullback for all $e\in M$. The full subcategory of the
  codomain spanned by pullback squares is closed under limits,
  completing the proof.

Why is $S$ continuous in each variable? Why is the stated full subcategory closed under limits?
I'm guessing the former has to do with Yoneda and the latter is simply commutation of limits with limits, but I'd like to make sure.
Added. Having already received an answer (which conflicts with the stated theorem), I asked to have this question migrated to MO in order to receive more input. I'm hesitant to accept the author has stated a false theorem, but do not see why $S$ is continuous in each variable.
Added. Am I correct in saying moreover that Theorem 1.17 holds in prefactorization systems in general?
 A: First of all, unless I'm overlooking something, $S$ preserves only pointwise limits in each argument, I'll write down a counterexample at the end of the post.
To show that it preserves those fix for example a morphism $e : A → B$ in $C$ to be the first argument of $S$, and denote the resulting functor $C^I → \mathrm{Set}^{I×I}$ with $S'$. (I'm using $I$ for the interval category here instead of $2$ to avoid ambiguity.) If $m : X → Y$ is the pointwise limit of a diagram of $m_i : X_i → Y_i$'s you need to prove that $S'(m)$ is the limit of $S'(m_i)$'s. But limits in $\mathrm{Set}^{I × I}$ are calculated pointwise, so you only need to show that every vertex of $S'(m)$ is the limit of the corresponding vertices of $S'(m_i)$ and ditto for the edges, and these all are just by the continuity of the covariant hom.
As for the second part, yes, it's just commutation of limits with limits. 
A limit of squares in the codomain is calculated pointwise, and if every square in a limit diagram is pullback, so is the limiting square.
To see that $S$ doesn't necessarily preserve limits in $C^I$ that aren't pointwise, take $C$ to be the subposet $\{\{1\}, \{5\}, \{1,2\}, \{1,3\}, \{1,4\}, \{1,2,3,5\}, \{1,3,4,5\}\}$ of $(\mathcal P(\mathbb N), ⊆)$. If you draw this poset, you will see that $h : \{1\} ⊆ \{1, 3\}$ is the product of $f : \{1,2\} ⊆ \{1,2,3,5\}$ and $g : \{1,4\} ⊆ \{1,3,4,5\}$ in $C^I$ (it's the only cone over them), but it isn't a pointwise product (since $\{1,2,3,5\}$ and $\{1,3,4,5\}$ don't have a meet in $C$). (This example is exercise 2.17.9 in Borceux's Handbook). Furthermore, $H = \mathrm{Hom}(\{5\}, -)^I$ doesn't preserve this limit, so $S(\mathrm{id}, -)$ can't presrve it either: $Hh$ is $∅ → ∅$, while $Hf$ and $Hg$ are isomorphic to $∅ → \{*\}$.
This doesn't seem to be much of a problem, however. If $C$ is complete, as I initially thought is assumed, then all limits in $C^I$ are pointwise, and if they aren't, I'm not sure of how much interest those that aren't pointwise would be.
