Ticket #2184: admin-header2.diff.txt

File admin-header2.diff.txt, 806 bytes (added by MattRead, 6 years ago)

fix ajaxcat and regex

Line 
1Index: wp-admin/admin-header.php
2===================================================================
3--- wp-admin/admin-header.php   (revision 3382)
4+++ wp-admin/admin-header.php   (working copy)
5@@ -130,7 +130,7 @@
6 
7 function newCatAddIn() {
8        if ( !document.getElementById('jaxcat') ) return false;
9-       var ajaxcat = document.createElement('p');
10+       var ajaxcat = document.createElement('span');
11        ajaxcat.id = 'ajaxcat';
12 
13        newcat = document.createElement('input');
14@@ -194,7 +194,7 @@
15        ids   = myPload( ajaxCat.response );
16        names = myPload( newcat.value );
17        for ( i = 0; i < ids.length; i++ ) {
18-               id = ids[i].replace(/[\n\r\l]+/g, "");
19+               id = ids[i].replace(/[\n\r]+/g, "");
20                if ( id == '-1' ) {
21                        p.innerHTML = "<?php echo addslashes(__("You don't have permission to do that.")); ?>";
22                        return;