Index: trunk/extensions/SemanticForms/libs/SF_submit.js |
— | — | @@ -121,9 +121,15 @@ |
122 | 122 | var stop = url.indexOf("?"); |
123 | 123 | if ( stop > 0 ) url = url.substring(0, stop); |
124 | 124 | |
125 | | - var start = url.indexOf( wgPageName ) + String(wgPageName).length + 1; |
126 | | - stop = url.indexOf("/", start); |
| 125 | + var start = url.indexOf( wgPageName ); // find start of page name |
| 126 | + start = url.indexOf("/", start) + 1; // find start of subpage |
127 | 127 | |
| 128 | + if ( start >= 0 ) { |
| 129 | + stop = url.indexOf("/", start); // find end of first subpage |
| 130 | + } else { |
| 131 | + stop = -1; |
| 132 | + } |
| 133 | + |
128 | 134 | if (stop >= 0) { |
129 | 135 | params += "&form=" + encodeURIComponent( url.substring(start, stop) ); |
130 | 136 | |