issue #4277 : Fix a bug of publish.js

issue #4277 : Fix a bug of publish.js