I am using the listings package inside my document, and to use a footnote inside the caption of a listing I had to separate the \caption from the \lstinputlisting.
If I create the document now, the listing with the separate caption seems to follow a different numbering than the other ones - while the surrounding listings are "Listing 5.6" and "Listing 5.7" the one with the separate caption is called "Listing 1".
Here's the code I am working with (I dumbed it down a bit, still the exact same structure as in the document though):
% This listing is working just fine (called Listing 5.6 in the document).
\begin{lstfloat}
\lstinputlisting[label=code:abort,caption={Workin caption here},captionpos=b]{Inhalt/Code/abort.js}
\end{lstfloat}
Here is some text to talk about the listing...
% This listing is suddenly called Listing 1
\begin{lstfloat}
\lstinputlisting[label=code:shell]{Inhalt/Code/shell.sh}
\caption[Manipulation und Abfrage der Daten mithilfe von cURL]{Manipulation und Abfrage der Daten mithilfe von cURL\protect\footnotemark}
\end{lstfloat}
\footnotetext{\url{https://curl.haxx.se/}}
% This listing is working file as well (called Listing 5.7 in the document)
\begin{lstfloat}
\lstinputlisting[label=code:connect,caption={Another working caption},captionpos=b]{Inhalt/Code/connect.js}
\end{lstfloat}
I am no LaTeX expert and I have no idea what is going wrong.

EDIT: I will try out putting the label below the caption and come back to you
EDIT: The issue persists. Putting the label below the caption is not the correct solution.
– Thomas Pötzsch Sep 12 '18 at 09:47